Module: Alchemy::Element::Definitions::ClassMethods
- Defined in:
- app/models/alchemy/element/definitions.rb
Instance Method Summary collapse
-
#definition_by_name(name) ⇒ Object
Returns one element definition by given name.
-
#definitions ⇒ Object
Returns the definitions from elements.yml file.
-
#definitions_repository=(klass) ⇒ Object
Register a custom element definitions repository.
Instance Method Details
#definition_by_name(name) ⇒ Object
Returns one element definition by given name.
30 31 32 |
# File 'app/models/alchemy/element/definitions.rb', line 30 def definition_by_name(name) definitions_repository.get(name) end |
#definitions ⇒ Object
Returns the definitions from elements.yml file.
Place a elements.yml
file inside your apps config/alchemy
folder to define your own set of elements
24 25 26 |
# File 'app/models/alchemy/element/definitions.rb', line 24 def definitions definitions_repository.all end |
#definitions_repository=(klass) ⇒ Object
Register a custom element definitions repository
The default repository is Alchemy::ElementDefinition
15 16 17 |
# File 'app/models/alchemy/element/definitions.rb', line 15 def definitions_repository=(klass) @_definitions_repository = klass end |