module Gearhead::Extensions::Attributes

Public Class Methods

included(klass) click to toggle source
# File lib/gearhead/extensions/attributes.rb, line 4
def self.included(klass)
  klass.define_gear_setting :custom_attributes, []
end

Public Instance Methods

_gear_attributes() click to toggle source
# File lib/gearhead/extensions/attributes.rb, line 8
def _gear_attributes
  @_gear_attributes
end
attribute(name, &block) click to toggle source
# File lib/gearhead/extensions/attributes.rb, line 20
def attribute(name, &block)
  @_gear_custom_attributes << [name, block]
end
attributes(*attrs) click to toggle source
# File lib/gearhead/extensions/attributes.rb, line 12
def attributes(*attrs)
  @_gear_attributes = *attrs
end
default_attributes() click to toggle source
# File lib/gearhead/extensions/attributes.rb, line 16
def default_attributes
  @resource.columns_hash.keys.map(&:to_sym)
end