module Substance::Objects::Attributes

Public Instance Methods

define_attribute(attribute) click to toggle source
# File lib/substance/objects/attributes.rb, line 21
def define_attribute(attribute)
  _attributes << attribute
  attr_accessor attribute
end
inherited(base) click to toggle source
Calls superclass method
# File lib/substance/objects/attributes.rb, line 14
def inherited(base)
  base._attributes = _attributes.dup
  super
end
to_h() click to toggle source
# File lib/substance/objects/attributes.rb, line 28
def to_h
  _attributes.each_with_object({}) { |attr, hash| hash[attr] = public_send(attr) }
end

Private Instance Methods

stringable_attributes() click to toggle source
# File lib/substance/objects/attributes.rb, line 34
def stringable_attributes
  self.class._attributes
end