Module: Alchemy::Element::Definitions::ClassMethods

Defined in:
app/models/alchemy/element/definitions.rb

Instance Method Summary collapse

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

#definitionsObject

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