Class: Flaker::ObjectWrapper
Instance Attribute Summary collapse
-
#data ⇒ Object
writeonly
Sets the attribute data.
Instance Method Summary collapse
-
#initialize(hash) ⇒ ObjectWrapper
constructor
A new instance of ObjectWrapper.
- #method_missing(method_name) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(hash) ⇒ ObjectWrapper
Returns a new instance of ObjectWrapper.
6 7 8 |
# File 'lib/flaker/wrapper.rb', line 6 def initialize(hash) @data = hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
10 11 12 |
# File 'lib/flaker/wrapper.rb', line 10 def method_missing(method_name) @data[method_name.to_s] unless @data.class == 'Hash' end |
Instance Attribute Details
#data=(value) ⇒ Object (writeonly)
Sets the attribute data
4 5 6 |
# File 'lib/flaker/wrapper.rb', line 4 def data=(value) @data = value end |