Class: Io::Flow::V0::Models::ItemShippingPricing
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ItemShippingPricing
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Available shipping price(s) a customer sees. This can be used for targetted ads on Google or to display shipping price(s) on a PDP.
Instance Attribute Summary collapse
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ItemShippingPricing
constructor
A new instance of ItemShippingPricing.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ItemShippingPricing
Returns a new instance of ItemShippingPricing.
47603 47604 47605 47606 47607 47608 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47603 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:min], 'ItemShippingPricing') @min = (x = opts.delete(:min); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @max = (x = opts.delete(:max); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))) end |
Instance Attribute Details
#max ⇒ Object (readonly)
Returns the value of attribute max.
47601 47602 47603 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47601 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
47601 47602 47603 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47601 def min @min end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47614 47615 47616 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47614 def copy(incoming={}) ItemShippingPricing.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
47618 47619 47620 47621 47622 47623 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47618 def to_hash { :min => min.to_hash, :max => max.nil? ? nil : max.to_hash } end |
#to_json ⇒ Object
47610 47611 47612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47610 def to_json JSON.dump(to_hash) end |