Class: Halogen::Definitions
- Inherits:
-
Hash
- Object
- Hash
- Halogen::Definitions
- Defined in:
- lib/halogen/definitions.rb
Overview
Each representer class has a Halogen::Definitions instance which stores Halogen::Definition instances by type.
Instance Method Summary collapse
-
#add(definition) ⇒ Halogen::Definition
The added definition.
Instance Method Details
#add(definition) ⇒ Halogen::Definition
Returns the added definition.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/halogen/definitions.rb', line 10 def add(definition) type = definition.class.name definition.validate self[type] ||= [] self[type] << definition definition end |