module EdgycircleToolbox::HasAttributes
Public Class Methods
included(base)
click to toggle source
# File lib/edgycircle_toolbox/has_attributes.rb, line 20 def self.included(base) base.class_eval do extend ClassMethods end end
new(attributes = {})
click to toggle source
# File lib/edgycircle_toolbox/has_attributes.rb, line 26 def initialize(attributes = {}) attributes.each do |key, value| setter = "#{key}=" public_send(setter, value) if respond_to?(setter) end end
Public Instance Methods
attributes()
click to toggle source
# File lib/edgycircle_toolbox/has_attributes.rb, line 33 def attributes self.class.attributes end