Class: WireClient::Account
- Inherits:
-
Object
- Object
- WireClient::Account
- Extended by:
- Converter
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/wire_client/account/account.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account_number ⇒ Object
Returns the value of attribute account_number.
-
#bic ⇒ Object
Returns the value of attribute bic.
-
#charge_bearer ⇒ Object
Returns the value of attribute charge_bearer.
-
#clear_system_code ⇒ Object
Returns the value of attribute clear_system_code.
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_subdivision ⇒ Object
Returns the value of attribute country_subdivision.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#iban ⇒ Object
Returns the value of attribute iban.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#name ⇒ Object
Returns the value of attribute name.
-
#schema_code ⇒ Object
Returns the value of attribute schema_code.
-
#wire_routing_number ⇒ Object
Returns the value of attribute wire_routing_number.
Instance Method Summary collapse
- #country_subdivision_abbr ⇒ Object
- #country_subdivision_name ⇒ Object
-
#initialize(attributes = {}) ⇒ Account
constructor
A new instance of Account.
Methods included from Converter
Constructor Details
#initialize(attributes = {}) ⇒ Account
Returns a new instance of Account.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/wire_client/account/account.rb', line 32 def initialize(attributes = {}) attributes.each do |name, value| public_send("#{name}=", value) end @currency ||= 'USD' @country ||= 'US' @country_subdivision ||= 'MA' if self.country == 'US' @schema_code ||= 'CUST' @clear_system_code ||= 'USABA' custom_defaults if self.respond_to? :custom_defaults end |
Instance Attribute Details
#account_number ⇒ Object
Returns the value of attribute account_number.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def account_number @account_number end |
#bic ⇒ Object
Returns the value of attribute bic.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def bic @bic end |
#charge_bearer ⇒ Object
Returns the value of attribute charge_bearer.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def charge_bearer @charge_bearer end |
#clear_system_code ⇒ Object
Returns the value of attribute clear_system_code.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def clear_system_code @clear_system_code end |
#country ⇒ Object
Returns the value of attribute country.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def country @country end |
#country_subdivision ⇒ Object
Returns the value of attribute country_subdivision.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def country_subdivision @country_subdivision end |
#currency ⇒ Object
Returns the value of attribute currency.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def currency @currency end |
#iban ⇒ Object
Returns the value of attribute iban.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def iban @iban end |
#identifier ⇒ Object
Returns the value of attribute identifier.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def identifier @identifier end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def name @name end |
#schema_code ⇒ Object
Returns the value of attribute schema_code.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def schema_code @schema_code end |
#wire_routing_number ⇒ Object
Returns the value of attribute wire_routing_number.
9 10 11 |
# File 'lib/wire_client/account/account.rb', line 9 def wire_routing_number @wire_routing_number end |
Instance Method Details
#country_subdivision_abbr ⇒ Object
45 46 47 48 49 50 |
# File 'lib/wire_client/account/account.rb', line 45 def country_subdivision_abbr if @country == 'US' && !@country_subdivision.match(/\A[A-Z]{2,2}\z/) return US_STATES[@country_subdivision] end @country_subdivision end |
#country_subdivision_name ⇒ Object
52 53 54 55 56 57 |
# File 'lib/wire_client/account/account.rb', line 52 def country_subdivision_name if @country == 'US' && @country_subdivision.match(/\A[A-Z]{2,2}\z/) return US_STATES.key(@country_subdivision) end @country_subdivision end |