Class: FidorApi::Beneficiary::Swift

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

Constant Summary

Constants inherited from Base

Base::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

included

Methods inherited from Base

#as_json, delete, new, #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



26
27
28
29
30
31
32
# File 'lib/fidor_api/beneficiary/swift.rb', line 26

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

#as_json_routing_typeObject



22
23
24
# File 'lib/fidor_api/beneficiary/swift.rb', line 22

def as_json_routing_type
  "SWIFT"
end

#set_attributes(attrs = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/fidor_api/beneficiary/swift.rb', line 15

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