Class: Besepa::Debit
- Includes:
- ApiCalls::Create, ApiCalls::Destroy, ApiCalls::List, ApiCalls::Update
- Defined in:
- lib/besepa/debit.rb
Constant Summary collapse
- FIELDS =
[:id, :reference, :amount, :currency, :status, :collect_at, :sent_at, :description, :metadata, :error_code, :platform_error_code, :created_at, :rejected_at, :debtor_bank_account_id, :creditor_bank_account_id]
- ALLOWED_NILS =
[:collect_at]
Constants included from Utils::Request
Utils::Request::END_POINT_URL_PREFIX
Instance Attribute Summary collapse
-
#creditor_bank_account ⇒ Object
Returns the value of attribute creditor_bank_account.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#debtor_bank_account ⇒ Object
Returns the value of attribute debtor_bank_account.
-
#remittance ⇒ Object
Returns the value of attribute remittance.
-
#subscription ⇒ Object
Returns the value of attribute subscription.
Attributes inherited from Resource
Instance Method Summary collapse
Methods included from ApiCalls::Destroy
Methods included from ApiCalls::Update
Methods included from ApiCalls::Create
Methods included from ApiCalls::List
Methods inherited from Resource
#as_json, handle_errors, #initialize, klass_name, #klass_name, #serializable_hash
Methods included from Utils::Request
Methods included from Utils::Connection
Constructor Details
This class inherits a constructor from Besepa::Resource
Instance Attribute Details
#creditor_bank_account ⇒ Object
Returns the value of attribute creditor_bank_account.
20 21 22 |
# File 'lib/besepa/debit.rb', line 20 def creditor_bank_account @creditor_bank_account end |
#customer ⇒ Object
Returns the value of attribute customer.
20 21 22 |
# File 'lib/besepa/debit.rb', line 20 def customer @customer end |
#debtor_bank_account ⇒ Object
Returns the value of attribute debtor_bank_account.
20 21 22 |
# File 'lib/besepa/debit.rb', line 20 def debtor_bank_account @debtor_bank_account end |
#remittance ⇒ Object
Returns the value of attribute remittance.
20 21 22 |
# File 'lib/besepa/debit.rb', line 20 def remittance @remittance end |
#subscription ⇒ Object
Returns the value of attribute subscription.
20 21 22 |
# File 'lib/besepa/debit.rb', line 20 def subscription @subscription end |
Instance Method Details
#allowed_nils ⇒ Object
35 36 37 |
# File 'lib/besepa/debit.rb', line 35 def allowed_nils ALLOWED_NILS end |
#to_hash ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/besepa/debit.rb', line 22 def to_hash values = {} self.class::FIELDS.each do |key| values[key] = self.send("#{key.to_s}") end values[:debtor_bank_account] = debtor_bank_account.to_hash if debtor_bank_account values[:creditor_bank_account] = creditor_bank_account.to_hash if creditor_bank_account values[:customer] = customer.to_hash if customer values[:remittance] = remittance.to_hash if remittance values[:subscription] = subscription.to_hash if subscription values end |