Module: Cosmos::Structure::MethodMissing
- Defined in:
- lib/cosmos/packets/structure.rb
Instance Method Summary collapse
-
#method_missing(name, value = nil) ⇒ Object
Method missing provides reading/writing item values as if they were methods to the class.
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
388 389 390 391 392 393 394 395 396 397 398 399 |
# File 'lib/cosmos/packets/structure.rb', line 388 def method_missing(name, value = nil) if @buffer 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 else raise "No buffer available for method_missing" end end |