Module: Superstore::AttributeMethods::ClassMethods

Defined in:
lib/superstore/attribute_methods.rb

Instance Method Summary collapse

Instance Method Details

#attribute_methods_generated?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/superstore/attribute_methods.rb', line 33

def attribute_methods_generated?
  @attribute_methods_generated ||= false
end

#define_attribute_methodsObject



27
28
29
30
31
# File 'lib/superstore/attribute_methods.rb', line 27

def define_attribute_methods
  return if attribute_methods_generated?
  super(attribute_definitions.keys)
  @attribute_methods_generated = true
end

#inherited(child_class) ⇒ Object



22
23
24
25
# File 'lib/superstore/attribute_methods.rb', line 22

def inherited(child_class)
  child_class.define_attribute_methods
  super
end