module Her::Model::Base

This module includes basic functionnality to Her::Model

Public Instance Methods

[](attribute_name) click to toggle source

Returns

  • the value of the attribute_name attribute if it's in orm data

  • the resource/collection corrsponding to attribute_name if it's an association

@private

# File lib/castle-her/model/base.rb, line 22
def [](attribute_name)
  get_attribute(attribute_name) ||
  get_association(attribute_name)
end
has_key?(attribute_name) click to toggle source

Returns true if attribute_name is

  • in resource attributes

  • an association

@private

# File lib/castle-her/model/base.rb, line 12
def has_key?(attribute_name)
  has_attribute?(attribute_name) ||
  has_association?(attribute_name)
end
singularized_resource_name() click to toggle source

@private

# File lib/castle-her/model/base.rb, line 28
def singularized_resource_name
  self.class.name.split('::').last.tableize.singularize
end