Class: SEPA::Transaction

Inherits:
Object
  • Object
show all
Extended by:
Converter
Includes:
ActiveModel::Validations
Defined in:
lib/sepa_king/transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Converter

convert

Constructor Details

#initialize(attributes = {}) ⇒ Transaction

Returns a new instance of Transaction.



20
21
22
23
24
25
26
27
28
# File 'lib/sepa_king/transaction.rb', line 20

def initialize(attributes = {})
  attributes.each do |name, value|
    send("#{name}=", value)
  end

  self.requested_date ||= Date.today.next
  self.reference ||= 'NOTPROVIDED'
  self.batch_booking = true if self.batch_booking.nil?
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



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

def amount
  @amount
end

#batch_bookingObject

Returns the value of attribute batch_booking.



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

def batch_booking
  @batch_booking
end

#bicObject

Returns the value of attribute bic.



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

def bic
  @bic
end

#ibanObject

Returns the value of attribute iban.



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

def iban
  @iban
end

#instructionObject

Returns the value of attribute instruction.



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

def instruction
  @instruction
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#referenceObject

Returns the value of attribute reference.



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

def reference
  @reference
end

#remittance_informationObject

Returns the value of attribute remittance_information.



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

def remittance_information
  @remittance_information
end

#requested_dateObject

Returns the value of attribute requested_date.



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

def requested_date
  @requested_date
end