Class: LloydsTSB::Transaction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Transaction

Returns a new instance of Transaction.



7
8
9
10
# File 'lib/lloydstsb/transaction.rb', line 7

def initialize(hash = {})
  hash.each { |key,val| send("#{key}=", val) if respond_to?("#{key}=") }
  @unique_reference = Digest::MD5.hexdigest("#{@date.to_s}:#{@narrative}:#{@amount}")
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



5
6
7
# File 'lib/lloydstsb/transaction.rb', line 5

def amount
  @amount
end

#dateObject

Returns the value of attribute date.



5
6
7
# File 'lib/lloydstsb/transaction.rb', line 5

def date
  @date
end

#directionObject

Returns the value of attribute direction.



5
6
7
# File 'lib/lloydstsb/transaction.rb', line 5

def direction
  @direction
end

#narrativeObject

Returns the value of attribute narrative.



5
6
7
# File 'lib/lloydstsb/transaction.rb', line 5

def narrative
  @narrative
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/lloydstsb/transaction.rb', line 5

def type
  @type
end

#unique_referenceObject

Returns the value of attribute unique_reference.



5
6
7
# File 'lib/lloydstsb/transaction.rb', line 5

def unique_reference
  @unique_reference
end