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.
Instance Method Details
#definition_by_name(name) ⇒ Object
Returns one element definition by given name.
19 20 21 |
# File 'app/models/alchemy/element/definitions.rb', line 19 def definition_by_name(name) definitions.detect { |d| d['name'] == 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
13 14 15 |
# File 'app/models/alchemy/element/definitions.rb', line 13 def definitions @definitions ||= read_definitions_file end |