Class: Io::Flow::V0::Models::ShopifyCartConversionShopifyCart
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyCartConversionShopifyCart
- 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 = {}) ⇒ ShopifyCartConversionShopifyCart
constructor
A new instance of ShopifyCartConversionShopifyCart.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyCartConversionShopifyCart
Returns a new instance of ShopifyCartConversionShopifyCart.
48468 48469 48470 48471 48472 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48468 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:cart], 'ShopifyCartConversionShopifyCart') @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.
48466 48467 48468 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48466 def cart @cart end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
48478 48479 48480 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48478 def copy(incoming={}) ShopifyCartConversionShopifyCart.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
48482 48483 48484 48485 48486 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48482 def to_hash { :cart => cart.to_hash } end |
#to_json ⇒ Object
48474 48475 48476 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48474 def to_json JSON.dump(to_hash) end |