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

Returns a new instance of CustomerLastUsed.



27862
27863
27864
27865
27866
27867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27862

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.



27860
27861
27862
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27860

def order
  @order
end

#paymentObject (readonly)

Returns the value of attribute payment.



27860
27861
27862
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27860

def payment
  @payment
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



27873
27874
27875
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27873

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

#to_hashObject



27877
27878
27879
27880
27881
27882
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27877

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

#to_jsonObject



27869
27870
27871
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27869

def to_json
  JSON.dump(to_hash)
end