Class: Io::Flow::V0::Models::DiscountOfferFixed
- Inherits:
-
DiscountOffer
- Object
- DiscountOffer
- Io::Flow::V0::Models::DiscountOfferFixed
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#money ⇒ Object
readonly
Returns the value of attribute money.
Attributes inherited from DiscountOffer
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ DiscountOfferFixed
constructor
A new instance of DiscountOfferFixed.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from DiscountOffer
Constructor Details
#initialize(incoming = {}) ⇒ DiscountOfferFixed
Returns a new instance of DiscountOfferFixed.
30047 30048 30049 30050 30051 30052 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30047 def initialize(incoming={}) super(:discriminator => DiscountOffer::Types::DISCOUNT_OFFER_FIXED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:money], 'DiscountOfferFixed') @money = (x = opts.delete(:money); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) end |
Instance Attribute Details
#money ⇒ Object (readonly)
Returns the value of attribute money.
30045 30046 30047 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30045 def money @money end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30058 30059 30060 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30058 def copy(incoming={}) DiscountOfferFixed.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
30062 30063 30064 30065 30066 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30062 def subtype_to_hash { :money => money.to_hash } end |
#to_json ⇒ Object
30054 30055 30056 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30054 def to_json JSON.dump(to_hash) end |