Class: Io::Flow::V0::Models::ShopifyCartShopifyRepresentation
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyCartShopifyRepresentation
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#cart ⇒ Object
readonly
Returns the value of attribute cart.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyCartShopifyRepresentation
constructor
A new instance of ShopifyCartShopifyRepresentation.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyCartShopifyRepresentation
45390 45391 45392 45393 45394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45390 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:cart], 'ShopifyCartShopifyRepresentation') @cart = (x = opts.delete(:cart); x.is_a?(::Io::Flow::Shopify::External::V0::Models::ShopifyCart) ? x : ::Io::Flow::Shopify::External::V0::Models::ShopifyCart.new(x)) end |
Instance Attribute Details
#cart ⇒ Object (readonly)
Returns the value of attribute cart.
45388 45389 45390 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45388 def cart @cart end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
45400 45401 45402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45400 def copy(incoming={}) ShopifyCartShopifyRepresentation.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
45404 45405 45406 45407 45408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45404 def to_hash { :cart => cart.to_hash } end |
#to_json ⇒ Object
45396 45397 45398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45396 def to_json JSON.dump(to_hash) end |