Class: FidorApi::Transfer::Swift

Inherits:
Base show all
Includes:
Generic
Defined in:
lib/fidor_api/transfer/swift.rb

Constant Summary

Constants included from Generic

Generic::ROUTING_INFO_ERROR_PREFIX

Instance Attribute Summary

Attributes inherited from Base

#confirmable_action

Attributes inherited from Connectivity::Resource

#error_keys

Instance Method Summary collapse

Methods included from Generic

#as_json, included, required_attributes

Methods inherited from Base

#needs_confirmation?, #save

Methods inherited from Connectivity::Resource

all, find, #initialize, model_name, #persisted?, #reload, #save, #update_attributes

Constructor Details

This class inherits a constructor from FidorApi::Connectivity::Resource

Instance Method Details

#as_json_routing_infoObject



28
29
30
31
32
33
34
# File 'lib/fidor_api/transfer/swift.rb', line 28

def as_json_routing_info
  {
    account_number:   ,
    swift_code:       swift_code,
    account_currency: 
  }
end

#as_json_routing_typeObject



24
25
26
# File 'lib/fidor_api/transfer/swift.rb', line 24

def as_json_routing_type
  "SWIFT"
end

#set_attributes(attrs = {}) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/fidor_api/transfer/swift.rb', line 16

def set_attributes(attrs = {})
  set_beneficiary_attributes(attrs)
  self.   = attrs.fetch("beneficiary", {}).fetch("routing_info", {})["account_number"]
  self.swift_code       = attrs.fetch("beneficiary", {}).fetch("routing_info", {})["swift_code"]
  self. = attrs.fetch("beneficiary", {}).fetch("routing_info", {})["account_currency"]
  super(attrs.except("beneficiary"))
end