Class: SixSaferpay::DirectDebit

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/direct_debit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mandate_id:, creditor_id:) ⇒ DirectDebit

Returns a new instance of DirectDebit.



6
7
8
9
# File 'lib/six_saferpay/models/direct_debit.rb', line 6

def initialize(mandate_id:, creditor_id:)
  @mandate_id = mandate_id
  @creditor_id = creditor_id
end

Instance Attribute Details

#creditor_idObject

Returns the value of attribute creditor_id.



4
5
6
# File 'lib/six_saferpay/models/direct_debit.rb', line 4

def creditor_id
  @creditor_id
end

#mandate_idObject

Returns the value of attribute mandate_id.



4
5
6
# File 'lib/six_saferpay/models/direct_debit.rb', line 4

def mandate_id
  @mandate_id
end

Instance Method Details

#to_hashObject Also known as: to_h



11
12
13
14
15
16
# File 'lib/six_saferpay/models/direct_debit.rb', line 11

def to_hash
  hash = Hash.new
  hash.merge!(mandate_id: @mandate_id) if @mandate_id
  hash.merge!(creditor_id: @creditor_id) if @creditor_id
  hash
end