Class: OFX::Statement::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/ofx/statement/transaction.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, options = {})
  @amount = amount
  @date = date
  @name = name
  @memo = options[:memo]
  @trntype = verify_trntype(options[:trntype].nil? ? default_trntype : options[:trntype])
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



10
11
12
# File 'lib/ofx/statement/transaction.rb', line 10

def amount
  @amount
end

#dateObject (readonly)

Returns the value of attribute date.



10
11
12
# File 'lib/ofx/statement/transaction.rb', line 10

def date
  @date
end

#memoObject (readonly)

Returns the value of attribute memo.



10
11
12
# File 'lib/ofx/statement/transaction.rb', line 10

def memo
  @memo
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/ofx/statement/transaction.rb', line 10

def name
  @name
end

#statementObject

Returns the value of attribute statement.



11
12
13
# File 'lib/ofx/statement/transaction.rb', line 11

def statement
  @statement
end

#trntypeObject (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_trntypesObject



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

#fitidObject



25
26
27
# File 'lib/ofx/statement/transaction.rb', line 25

def fitid
  statement.fitid_for(self)
end

#has_memo?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ofx/statement/transaction.rb', line 21

def has_memo?
  !(memo.nil? || memo.empty?)
end