Class: Representable::Config::Definitions
- Inherits:
-
Inheritable::Hash
- Object
- Hash
- Inheritable::Hash
- Representable::Config::Definitions
- Extended by:
- Forwardable
- Defined in:
- lib/representable/config.rb
Overview
Stores Definitions from ::property. It preserves the adding order (1.9+). Same-named properties get overridden, just like in a Hash.
Instance Method Summary collapse
Methods included from Inheritable::Hash::InstanceMethods
Instance Method Details
#add(name, options, &block) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/representable/config.rb', line 18 def add(name, , &block) if [:inherit] # i like that: the :inherit shouldn't be handled outside. return get(name).merge!(, &block) end self[name.to_s] = Definition.new(name, , &block) end |
#get(name) ⇒ Object
26 27 28 |
# File 'lib/representable/config.rb', line 26 def get(name) self[name.to_s] end |