Class: Quicken::Foundation

Inherits:
Object
  • Object
show all
Defined in:
lib/quicken/foundation.rb

Direct Known Subclasses

Account, Transaction

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Foundation

Returns a new instance of Foundation.



12
13
14
15
16
17
18
19
20
# File 'lib/quicken/foundation.rb', line 12

def initialize(attrs={})
  attrs.each do |key, value| 
    begin
      send("#{key}=", value) 
    rescue
      next
    end
  end
end

Class Method Details

.accessors_for_spec(spec) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/quicken/foundation.rb', line 4

def self.accessors_for_spec(spec)
  spec.each do |key, item|
    instance_eval do
      attr_accessor key.to_sym
    end
  end
end