Class: FidorApi::Model::StandingOrder

Inherits:
Base
  • Object
show all
Includes:
BeneficiaryHelper
Defined in:
lib/fidor_api/model/standing_order.rb

Constant Summary

Constants included from BeneficiaryHelper

BeneficiaryHelper::SUPPORTED_ROUTING_TYPES

Instance Attribute Summary

Attributes inherited from Base

#confirmable_action_id

Instance Method Summary collapse

Methods included from BeneficiaryHelper

#define_methods_for, #parse_errors

Methods inherited from Base

#as_json, inherited, #parse_errors, resource_name

Instance Method Details

#beneficiary=(value) ⇒ Object



19
20
21
22
# File 'lib/fidor_api/model/standing_order.rb', line 19

def beneficiary=(value)
  write_attribute(:beneficiary, value)
  define_methods_for(SUPPORTED_ROUTING_TYPES[beneficiary['routing_type']])
end

#routing_typeObject



24
25
26
27
# File 'lib/fidor_api/model/standing_order.rb', line 24

def routing_type
  @beneficiary ||= {}
  @beneficiary.dig('routing_type')
end

#routing_type=(type) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/fidor_api/model/standing_order.rb', line 29

def routing_type=(type)
  raise Errors::NotSupported unless SUPPORTED_ROUTING_TYPES.key?(type)

  @beneficiary ||= {}
  @beneficiary['routing_type'] = type
  define_methods_for(SUPPORTED_ROUTING_TYPES[type])
end