Module: OpenC3::Structure::MethodMissing

Defined in:
lib/openc3/packets/structure.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, value = nil) ⇒ Object

Method missing provides reading/writing item values as if they were methods to the class



559
560
561
562
563
564
565
566
# File 'lib/openc3/packets/structure.rb', line 559

def method_missing(name, value = nil)
  if value
    # Strip off the equals sign before looking up the item
    return write(name.to_s[0..-2], value)
  else
    return read(name.to_s)
  end
end