Class: Syrup::Transaction
- Inherits:
-
Object
- Object
- Syrup::Transaction
- Defined in:
- lib/syrup/transaction.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#id ⇒ Object
Returns the value of attribute id.
-
#payee ⇒ Object
Returns the value of attribute payee.
-
#posted_at ⇒ Object
Returns the value of attribute posted_at.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(attr_hash = nil) ⇒ Transaction
constructor
New objects can be instantiated as either empty (pass no construction parameter) or pre-set with attributes (pass a hash with key names matching the associated attribute names).
Constructor Details
#initialize(attr_hash = nil) ⇒ Transaction
New objects can be instantiated as either empty (pass no construction parameter) or pre-set with attributes (pass a hash with key names matching the associated attribute names).
12 13 14 15 16 17 18 |
# File 'lib/syrup/transaction.rb', line 12 def initialize(attr_hash = nil) if attr_hash attr_hash.each do |k, v| instance_variable_set "@#{k}", v end end end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
8 9 10 |
# File 'lib/syrup/transaction.rb', line 8 def amount @amount end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/syrup/transaction.rb', line 8 def id @id end |
#payee ⇒ Object
Returns the value of attribute payee.
8 9 10 |
# File 'lib/syrup/transaction.rb', line 8 def payee @payee end |
#posted_at ⇒ Object
Returns the value of attribute posted_at.
8 9 10 |
# File 'lib/syrup/transaction.rb', line 8 def posted_at @posted_at end |
#status ⇒ Object
Returns the value of attribute status.
8 9 10 |
# File 'lib/syrup/transaction.rb', line 8 def status @status end |