class Io::Flow::V0::Models::PaymentContactShipping

Attributes

email[R]
first_name[R]
last_name[R]
phone[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 56644
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:last_name, :email], 'PaymentContactShipping')
  @first_name = (x = opts.delete(:first_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('first_name', x, String))
  @last_name = HttpClient::Preconditions.assert_class('last_name', opts.delete(:last_name), String)
  @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String)
  @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 56657
def copy(incoming={})
  PaymentContactShipping.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 56661
def to_hash
  {
    :first_name => first_name,
    :last_name => last_name,
    :email => email,
    :phone => phone
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 56653
def to_json
  JSON.dump(to_hash)
end