class PaymentsApi::Beneficiary

Beneficiary Information Object

Attributes

address[RW]

Address Information @return [Address]

email[RW]

Beneficiary Email Address @return [String]

name[RW]

Beneficiary Name @return [String]

phone_number[RW]

Beneficiary Phone Number @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/payments_api/models/beneficiary.rb, line 46
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash['name']
  address = Address.from_hash(hash['address']) if hash['address']
  email = hash['email']
  phone_number = hash['phoneNumber']

  # Create object from extracted values.
  Beneficiary.new(name,
                  address,
                  email,
                  phone_number)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/payments_api/models/beneficiary.rb, line 26
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['address'] = 'address'
  @_hash['email'] = 'email'
  @_hash['phone_number'] = 'phoneNumber'
  @_hash
end
new(name = nil, address = nil, email = nil, phone_number = nil) click to toggle source
# File lib/payments_api/models/beneficiary.rb, line 35
def initialize(name = nil,
               address = nil,
               email = nil,
               phone_number = nil)
  @name = name
  @address = address
  @email = email
  @phone_number = phone_number
end