Sha256: da4eac0fe6e2e9dd6c0bfde630b62820cb5b88f1c8a7fcfdf9244ee96452d341
Contents?: true
Size: 436 Bytes
Versions: 13
Compression:
Stored size: 436 Bytes
Contents
class Transaction attr_accessor :type, :amount, :year def self.truncate @@all = [] end def self.create(attrs) txn = Transaction.new(attrs) @@all << txn txn end def self.find_all(attrs) @@all.select do |txn| attrs.all? { |k, v| txn.send(k) == v } end end def initialize(attrs) self.type = attrs[:type] self.amount = attrs[:amount] self.year = attrs[:year] end end
Version data entries
13 entries across 13 versions & 1 rubygems