module EdgycircleToolbox::HasAttributes::ClassMethods

Public Instance Methods

attributes(*attributes) click to toggle source
# File lib/edgycircle_toolbox/has_attributes.rb, line 4
def attributes(*attributes)
  @attributes ||= []

  return @attributes unless attributes.any?

  attributes.each do |attribute|
    define_attr_accessor(attribute)
    @attributes << attribute
  end
end
define_attr_accessor(attribute) click to toggle source
# File lib/edgycircle_toolbox/has_attributes.rb, line 15
def define_attr_accessor(attribute)
  attr_accessor(attribute)
end