Is there a way to validate the fields being set on a BinData::Record during initialization? The check_value for each parameter appears to only be evaluated after reading from an input stream
class Foo < BinData::Record
uint8 :bar,:check_value=>lambda{raise 'Here is an error'}
end
Foo.new(:bar=>5) #Does not raise validation exception
I've tried adding an 'initialize_instance' where it does a read on 'to_binary_s' but it throws some other errors, presumably because the object isn't fully instantiated.