Class: Xirr::Transaction
- Inherits:
-
Object
- Object
- Xirr::Transaction
- Defined in:
- lib/xirr/transaction.rb
Overview
A unit of the Cashflow.
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#date ⇒ Object
Returns the value of attribute date.
Instance Method Summary collapse
-
#initialize(amount, opts = {}) ⇒ Transaction
constructor
A new instance of Transaction.
- #inspect ⇒ String
Constructor Details
#initialize(amount, opts = {}) ⇒ Transaction
Returns a new instance of Transaction.
12 13 14 15 |
# File 'lib/xirr/transaction.rb', line 12 def initialize(amount, opts = {}) self.amount = amount opts.each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
6 7 8 |
# File 'lib/xirr/transaction.rb', line 6 def amount @amount end |
#date ⇒ Object
Returns the value of attribute date.
6 7 8 |
# File 'lib/xirr/transaction.rb', line 6 def date @date end |
Instance Method Details
#inspect ⇒ String
32 33 34 |
# File 'lib/xirr/transaction.rb', line 32 def inspect "T(#{@amount},#{@date})" end |