Class: Io::Flow::V0::Models::FreeShipping
- Inherits:
-
AvailablePromotion
- Object
- AvailablePromotion
- Io::Flow::V0::Models::FreeShipping
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#trigger ⇒ Object
readonly
Returns the value of attribute trigger.
Attributes inherited from AvailablePromotion
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FreeShipping
constructor
A new instance of FreeShipping.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from AvailablePromotion
Constructor Details
#initialize(incoming = {}) ⇒ FreeShipping
Returns a new instance of FreeShipping.
12691 12692 12693 12694 12695 12696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12691 def initialize(incoming={}) super(:discriminator => AvailablePromotion::Types::FREE_SHIPPING) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:trigger], 'FreeShipping') @trigger = (x = opts.delete(:trigger); x.is_a?(::Io::Flow::V0::Models::PromotionTrigger) ? x : ::Io::Flow::V0::Models::PromotionTrigger.new(x)) end |
Instance Attribute Details
#trigger ⇒ Object (readonly)
Returns the value of attribute trigger.
12689 12690 12691 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12689 def trigger @trigger end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
12702 12703 12704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12702 def copy(incoming={}) FreeShipping.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
12706 12707 12708 12709 12710 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12706 def subtype_to_hash { :trigger => trigger.to_hash } end |
#to_json ⇒ Object
12698 12699 12700 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12698 def to_json JSON.dump(to_hash) end |