Module: ClassSupportMixin::InstanceMethods
- Defined in:
- lib/aninipot/support.rb
Instance Method Summary collapse
Instance Method Details
#attributes ⇒ Object
24 25 26 27 28 |
# File 'lib/aninipot/support.rb', line 24 def attributes attrs = {} self.default_attributes.keys.each {|k| attrs[k] = self.send(k) if self.respond_to?(k)} attrs end |
#initialize(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/aninipot/support.rb', line 15 def initialize(={}) init = if self.respond_to?(:default_attributes) self.default_attributes.merge() else end init.each { |k, v| self.send("#{k}=", v) if self.respond_to?(k) } end |