Class: Saveconf::Accessor
- Inherits:
-
Object
- Object
- Saveconf::Accessor
- Defined in:
- lib/saveconf/config.rb
Overview
the object that is capable of giving me the children of complex attributes
Instance Method Summary collapse
- #get(name) ⇒ Object
-
#initialize(hash, prefix) ⇒ Accessor
constructor
A new instance of Accessor.
Constructor Details
#initialize(hash, prefix) ⇒ Accessor
Returns a new instance of Accessor.
6 7 8 9 |
# File 'lib/saveconf/config.rb', line 6 def initialize(hash, prefix) @hash = hash @prefix = prefix end |
Instance Method Details
#get(name) ⇒ Object
11 12 13 |
# File 'lib/saveconf/config.rb', line 11 def get(name) @hash[(@prefix.dup << name).join('.')] end |