class Io::Flow::V0::Models::DiscountRule
Attributes
offers[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40116 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:offers], 'DiscountRule') @offers = HttpClient::Preconditions.assert_class('offers', opts.delete(:offers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DiscountRuleOffer) ? x : ::Io::Flow::V0::Models::DiscountRuleOffer.new(x)) } end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40126 def copy(incoming={}) DiscountRule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40130 def to_hash { :offers => offers.map { |o| o.to_hash } } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40122 def to_json JSON.dump(to_hash) end