Class: PolymorphicEnumType::Config
- Inherits:
-
Object
- Object
- PolymorphicEnumType::Config
- Defined in:
- lib/polymorphic_enum_type/config.rb
Instance Method Summary collapse
- #add(attr, hash) ⇒ Object
- #enum_hash(attr) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
5 6 7 |
# File 'lib/polymorphic_enum_type/config.rb', line 5 def initialize @h = {} end |
Instance Method Details
#add(attr, hash) ⇒ Object
9 10 11 |
# File 'lib/polymorphic_enum_type/config.rb', line 9 def add(attr, hash) h[attr.to_sym] = hash end |
#enum_hash(attr) ⇒ Object
13 14 15 |
# File 'lib/polymorphic_enum_type/config.rb', line 13 def enum_hash(attr) h.fetch(attr.to_sym).invert end |