Module: Alchemy::Element::Definitions

Extended by:
ActiveSupport::Concern
Included in:
Alchemy::Element
Defined in:
app/models/alchemy/element/definitions.rb

Overview

Module concerning element definitions

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#definitionObject

The definition of this element.



44
45
46
47
48
49
50
51
# File 'app/models/alchemy/element/definitions.rb', line 44

def definition
  if definition = self.class.definitions.detect { |d| d['name'] == name }
    definition
  else
    log_warning "Could not find element definition for #{name}. Please check your elements.yml file!"
    return {}
  end
end