Method: OpenC3::GenericConversion#initialize
- Defined in:
- lib/openc3/conversions/generic_conversion.rb
#initialize(code_to_eval, converted_type = nil, converted_bit_size = nil, converted_array_size = nil) ⇒ GenericConversion
Returns a new instance of GenericConversion.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/openc3/conversions/generic_conversion.rb', line 41 def initialize(code_to_eval, converted_type = nil, converted_bit_size = nil, converted_array_size = nil) super() @code_to_eval = code_to_eval if ConfigParser.handle_nil(converted_type) converted_type = converted_type.to_s.upcase.intern raise "Invalid type #{converted_type}" unless BinaryAccessor::DATA_TYPES.include?(converted_type) @converted_type = converted_type end @converted_bit_size = Integer(converted_bit_size) if ConfigParser.handle_nil(converted_bit_size) @converted_array_size = Integer(converted_array_size) if ConfigParser.handle_nil(converted_array_size) @params = [@code_to_eval, @converted_type, @converted_bit_size, @converted_array_size] end |