Class: LloydsTSB::Transaction
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#date ⇒ Object
Returns the value of attribute date.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#narrative ⇒ Object
Returns the value of attribute narrative.
-
#type ⇒ Object
Returns the value of attribute type.
-
#unique_reference ⇒ Object
Returns the value of attribute unique_reference.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Transaction
constructor
A new instance of Transaction.
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
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/lloydstsb/transaction.rb', line 5 def amount @amount end |
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/lloydstsb/transaction.rb', line 5 def date @date end |
#direction ⇒ Object
Returns the value of attribute direction.
5 6 7 |
# File 'lib/lloydstsb/transaction.rb', line 5 def direction @direction end |
#narrative ⇒ Object
Returns the value of attribute narrative.
5 6 7 |
# File 'lib/lloydstsb/transaction.rb', line 5 def narrative @narrative end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/lloydstsb/transaction.rb', line 5 def type @type end |
#unique_reference ⇒ Object
Returns the value of attribute unique_reference.
5 6 7 |
# File 'lib/lloydstsb/transaction.rb', line 5 def unique_reference @unique_reference end |