Class: SEPA::Transaction

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

Constant Summary collapse

DEFAULT_REQUESTED_DATE =
Date.new(1999, 1, 1).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Converter

convert

Constructor Details

#initialize(attributes = {}) ⇒ Transaction

Returns a new instance of Transaction.


35
36
37
38
39
40
41
42
43
44
# File 'lib/sepa_king/transaction.rb', line 35

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

  self.requested_date ||= DEFAULT_REQUESTED_DATE
  self.reference ||= 'NOTPROVIDED'
  self.batch_booking = true if self.batch_booking.nil?
  self.currency ||= 'EUR'
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def amount
  @amount
end

#batch_bookingObject

Returns the value of attribute batch_booking.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def batch_booking
  @batch_booking
end

#bicObject

Returns the value of attribute bic.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def bic
  @bic
end

#creditor_addressObject

Returns the value of attribute creditor_address.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def creditor_address
  @creditor_address
end

#currencyObject

Returns the value of attribute currency.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def currency
  @currency
end

#debtor_addressObject

Returns the value of attribute debtor_address.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def debtor_address
  @debtor_address
end

#ibanObject

Returns the value of attribute iban.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def iban
  @iban
end

#instructionObject

Returns the value of attribute instruction.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def instruction
  @instruction
end

#nameObject

Returns the value of attribute name.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def name
  @name
end

#referenceObject

Returns the value of attribute reference.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def reference
  @reference
end

#remittance_informationObject

Returns the value of attribute remittance_information.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def remittance_information
  @remittance_information
end

#requested_dateObject

Returns the value of attribute requested_date.


9
10
11
# File 'lib/sepa_king/transaction.rb', line 9

def requested_date
  @requested_date
end