Class: Io::Flow::V0::Models::CustomerBundle
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CustomerBundle
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A bundle of all the content needed to render customer data.
Instance Attribute Summary collapse
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#last_used ⇒ Object
readonly
Returns the value of attribute last_used.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CustomerBundle
constructor
A new instance of CustomerBundle.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CustomerBundle
Returns a new instance of CustomerBundle.
27301 27302 27303 27304 27305 27306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27301 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 |
Instance Attribute Details
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
27299 27300 27301 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27299 def customer @customer end |
#last_used ⇒ Object (readonly)
Returns the value of attribute last_used.
27299 27300 27301 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27299 def last_used @last_used end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
27312 27313 27314 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27312 def copy(incoming={}) CustomerBundle.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
27316 27317 27318 27319 27320 27321 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27316 def to_hash { :customer => customer.to_hash, :last_used => last_used.nil? ? nil : last_used.to_hash } end |
#to_json ⇒ Object
27308 27309 27310 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27308 def to_json JSON.dump(to_hash) end |