Class: OFX::Statement::Transaction
- Inherits:
-
Object
- Object
- OFX::Statement::Transaction
- Defined in:
- lib/ofx/statement/transaction.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#memo ⇒ Object
readonly
Returns the value of attribute memo.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#statement ⇒ Object
Returns the value of attribute statement.
-
#trntype ⇒ Object
readonly
Returns the value of attribute trntype.
Class Method Summary collapse
Instance Method Summary collapse
- #fitid ⇒ Object
- #has_memo? ⇒ Boolean
-
#initialize(amount, date, name, options = {}) ⇒ Transaction
constructor
A new instance of Transaction.
Constructor Details
#initialize(amount, date, name, options = {}) ⇒ Transaction
Returns a new instance of Transaction.
13 14 15 16 17 18 19 |
# File 'lib/ofx/statement/transaction.rb', line 13 def initialize(amount, date, name, = {}) @amount = amount @date = date @name = name @memo = [:memo] @trntype = verify_trntype([:trntype].nil? ? default_trntype : [:trntype]) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
10 11 12 |
# File 'lib/ofx/statement/transaction.rb', line 10 def amount @amount end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
10 11 12 |
# File 'lib/ofx/statement/transaction.rb', line 10 def date @date end |
#memo ⇒ Object (readonly)
Returns the value of attribute memo.
10 11 12 |
# File 'lib/ofx/statement/transaction.rb', line 10 def memo @memo end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/ofx/statement/transaction.rb', line 10 def name @name end |
#statement ⇒ Object
Returns the value of attribute statement.
11 12 13 |
# File 'lib/ofx/statement/transaction.rb', line 11 def statement @statement end |
#trntype ⇒ Object (readonly)
Returns the value of attribute trntype.
10 11 12 |
# File 'lib/ofx/statement/transaction.rb', line 10 def trntype @trntype end |
Class Method Details
.valid_trntypes ⇒ Object
5 6 7 |
# File 'lib/ofx/statement/transaction.rb', line 5 def valid_trntypes @valid_trntypes ||= OFX::Statement::Output::Base.trntype_hash.keys end |
Instance Method Details
#fitid ⇒ Object
25 26 27 |
# File 'lib/ofx/statement/transaction.rb', line 25 def fitid statement.fitid_for(self) end |
#has_memo? ⇒ Boolean
21 22 23 |
# File 'lib/ofx/statement/transaction.rb', line 21 def has_memo? !(memo.nil? || memo.empty?) end |