Module: Pio::MessageTypeSelector
Overview
Macros for defining message types.
Instance Method Summary collapse
Instance Method Details
#message_type(options) ⇒ Object
7 8 9 |
# File 'lib/pio/message_type_selector.rb', line 7 def () const_set(:MESSAGE_TYPE, ) end |
#read(raw_data) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/pio/message_type_selector.rb', line 11 def read(raw_data) format = const_get(:Format).read(raw_data) = const_get(:MESSAGE_TYPE)[format.].allocate .instance_variable_set :@format, format rescue raise Pio::ParseError, $ERROR_INFO. end |