Class: WeatherLink::HashWrapper
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- WeatherLink::HashWrapper
- Defined in:
- lib/weatherlink/hash_wrapper.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ HashWrapper
constructor
A new instance of HashWrapper.
Constructor Details
#initialize(data) ⇒ HashWrapper
Returns a new instance of HashWrapper.
9 10 11 12 |
# File 'lib/weatherlink/hash_wrapper.rb', line 9 def initialize(data) @data = data super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object (private)
16 17 18 19 20 |
# File 'lib/weatherlink/hash_wrapper.rb', line 16 def method_missing(symbol, *args) return data.fetch(symbol.to_s) if data.include?(symbol.to_s) super end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/weatherlink/hash_wrapper.rb', line 7 def data @data end |