Class: Boxspring::Base

Inherits:
ActiveHash::Base
  • Object
show all
Defined in:
lib/boxspring/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) {|_self| ... } ⇒ Base

Returns a new instance of Base.

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
9
10
11
12
# File 'lib/boxspring/base.rb', line 5

def initialize( attributes = {} )
   attributes.symbolize_keys!
   @attributes = attributes
   attributes.dup.each do | key, value |
     send( "#{key}=", value ) if respond_to?( "#{key}=" )
   end
   yield self if block_given?
end