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.
67272 67273 67274 67275 67276 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67272 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::ShopifyExternalCart) ? x : ::Io::Flow::Shopify::External::V0::Models::ShopifyExternalCart.new(x)) end |
Instance Attribute Details
#cart ⇒ Object (readonly)
Returns the value of attribute cart.
67270 67271 67272 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67270 def cart @cart end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
67282 67283 67284 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67282 def copy(incoming={}) ShopifyCartConversionShopifyCart.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
67286 67287 67288 67289 67290 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67286 def to_hash { :cart => cart.to_hash } end |
#to_json ⇒ Object
67278 67279 67280 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67278 def to_json JSON.dump(to_hash) end |