Class: Seam::DeepHashAccessor
- Inherits:
-
Object
- Object
- Seam::DeepHashAccessor
- Defined in:
- lib/seam/deep_hash_accessor.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(data) ⇒ DeepHashAccessor
constructor
A new instance of DeepHashAccessor.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ DeepHashAccessor
Returns a new instance of DeepHashAccessor.
7 8 9 10 |
# File 'lib/seam/deep_hash_accessor.rb', line 7 def initialize(data) @data = data create_accessor_methods end |
Instance Method Details
#[](key) ⇒ Object
12 13 14 |
# File 'lib/seam/deep_hash_accessor.rb', line 12 def [](key) instance_variable_get(:"@#{key}") end |
#to_h ⇒ Object
16 17 18 |
# File 'lib/seam/deep_hash_accessor.rb', line 16 def to_h @data end |