Class: Io::Flow::V0::Models::CustomerLastUsed

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Last used details pertaining to a customer.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CustomerLastUsed



26969
26970
26971
26972
26973
26974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26969

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order, :payment], 'CustomerLastUsed')
  @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::CustomerOrder) ? x : ::Io::Flow::V0::Models::CustomerOrder.new(x))
  @payment = (x = opts.delete(:payment); x.is_a?(::Io::Flow::V0::Models::CustomerPayment) ? x : ::Io::Flow::V0::Models::CustomerPayment.new(x))
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



26967
26968
26969
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26967

def order
  @order
end

#paymentObject (readonly)

Returns the value of attribute payment.



26967
26968
26969
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26967

def payment
  @payment
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26980
26981
26982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26980

def copy(incoming={})
  CustomerLastUsed.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



26984
26985
26986
26987
26988
26989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26984

def to_hash
  {
    :order => order.to_hash,
    :payment => payment.to_hash
  }
end

#to_jsonObject



26976
26977
26978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26976

def to_json
  JSON.dump(to_hash)
end