Class: Io::Flow::V0::Models::FreeShippingOrderPromotionForm
- Inherits:
-
OrderPromotionForm
- Object
- OrderPromotionForm
- Io::Flow::V0::Models::FreeShippingOrderPromotionForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#trigger ⇒ Object
readonly
Returns the value of attribute trigger.
Attributes inherited from OrderPromotionForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FreeShippingOrderPromotionForm
constructor
A new instance of FreeShippingOrderPromotionForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from OrderPromotionForm
Constructor Details
#initialize(incoming = {}) ⇒ FreeShippingOrderPromotionForm
Returns a new instance of FreeShippingOrderPromotionForm.
32295 32296 32297 32298 32299 32300 32301 32302 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32295 def initialize(incoming={}) super(:discriminator => OrderPromotionForm::Types::FREE_SHIPPING_ORDER_PROMOTION_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:trigger], 'FreeShippingOrderPromotionForm') @trigger = (x = opts.delete(:trigger); x.is_a?(::Io::Flow::V0::Models::PromotionTriggerForm) ? x : ::Io::Flow::V0::Models::PromotionTriggerForm.new(x)) @max = (x = opts.delete(:max); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PriceForm) ? x : ::Io::Flow::V0::Models::PriceForm.new(x))) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
32293 32294 32295 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32293 def attributes @attributes end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
32293 32294 32295 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32293 def max @max end |
#trigger ⇒ Object (readonly)
Returns the value of attribute trigger.
32293 32294 32295 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32293 def trigger @trigger end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32308 32309 32310 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32308 def copy(incoming={}) FreeShippingOrderPromotionForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
32312 32313 32314 32315 32316 32317 32318 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32312 def subtype_to_hash { :trigger => trigger.to_hash, :max => max.nil? ? nil : max.to_hash, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
32304 32305 32306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32304 def to_json JSON.dump(to_hash) end |