class Io::Flow::V0::Models::CustomerBundle
A bundle of all the content needed to render customer data.
Attributes
customer[R]
last_used[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 38304 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:customer], 'CustomerBundle') @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)) @last_used = (x = opts.delete(:last_used); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CustomerLastUsed) ? x : ::Io::Flow::V0::Models::CustomerLastUsed.new(x))) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 38315 def copy(incoming={}) CustomerBundle.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 38319 def to_hash { :customer => customer.to_hash, :last_used => last_used.nil? ? nil : last_used.to_hash } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 38311 def to_json JSON.dump(to_hash) end