Class: MercuryBanking::Recipient
- Inherits:
-
Object
- Object
- MercuryBanking::Recipient
- Defined in:
- lib/mercury_banking/recipient.rb
Overview
Recipient class for Mercury Banking API
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#region ⇒ Object
Returns the value of attribute region.
Instance Method Summary collapse
-
#initialize(name:, email:, account_number:, routing_number:, address:, city:, region:, postal_code:, country:) ⇒ Recipient
constructor
A new instance of Recipient.
- #json ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(name:, email:, account_number:, routing_number:, address:, city:, region:, postal_code:, country:) ⇒ Recipient
Returns a new instance of Recipient.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mercury_banking/recipient.rb', line 8 def initialize(name:, email:, account_number:, routing_number:, address:, city:, region:, postal_code:, country:) @name = name @address = { name: name, address1: address, city: city, region: region, postalCode: postal_code, country: country } @emails = [email] @payment_method = "electronic" @electronic_routing_info = { accountNumber: account_number, routingNumber: routing_number, electronicAccountType: "businessChecking", address: @address } end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
6 7 8 |
# File 'lib/mercury_banking/recipient.rb', line 6 def address @address end |
#city ⇒ Object
Returns the value of attribute city.
6 7 8 |
# File 'lib/mercury_banking/recipient.rb', line 6 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
6 7 8 |
# File 'lib/mercury_banking/recipient.rb', line 6 def country @country end |
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/mercury_banking/recipient.rb', line 6 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/mercury_banking/recipient.rb', line 6 def name @name end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
6 7 8 |
# File 'lib/mercury_banking/recipient.rb', line 6 def postal_code @postal_code end |
#region ⇒ Object
Returns the value of attribute region.
6 7 8 |
# File 'lib/mercury_banking/recipient.rb', line 6 def region @region end |
Instance Method Details
#json ⇒ Object
28 29 30 31 |
# File 'lib/mercury_banking/recipient.rb', line 28 def json { name: @name, address: @address, emails: @emails, paymentMethod: @payment_method, electronicRoutingInfo: @electronic_routing_info } end |
#to_json(*_args) ⇒ Object
33 34 35 |
# File 'lib/mercury_banking/recipient.rb', line 33 def to_json(*_args) json.to_json end |