Module: Gearbox::SemanticAccessors::InstanceMethods

Defined in:
lib/gearbox/mixins/semantic_accessors.rb

Instance Method Summary collapse

Instance Method Details

#attributesObject



47
48
49
50
51
52
# File 'lib/gearbox/mixins/semantic_accessors.rb', line 47

def attributes
  self.class.attributes.inject({:id => id}) do |hash, (name, opts)|
    hash[name] = send(name)
    hash
  end
end

#initialize(opts = {}) ⇒ Object



40
41
42
43
44
45
# File 'lib/gearbox/mixins/semantic_accessors.rb', line 40

def initialize(opts={})
  super
  assert_defaults
  assert_options(opts)
  @changed_attributes.clear if @changed_attributes
end