Class: Io::Flow::V0::Models::FlatRateForm
- Inherits:
-
TierRuleOutcomeForm
- Object
- TierRuleOutcomeForm
- Io::Flow::V0::Models::FlatRateForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Attributes inherited from TierRuleOutcomeForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FlatRateForm
constructor
A new instance of FlatRateForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from TierRuleOutcomeForm
Constructor Details
#initialize(incoming = {}) ⇒ FlatRateForm
Returns a new instance of FlatRateForm.
15862 15863 15864 15865 15866 15867 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15862 def initialize(incoming={}) super(:discriminator => TierRuleOutcomeForm::Types::FLAT_RATE_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:price], 'FlatRateForm') @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) end |
Instance Attribute Details
#price ⇒ Object (readonly)
Returns the value of attribute price.
15860 15861 15862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15860 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15873 15874 15875 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15873 def copy(incoming={}) FlatRateForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
15877 15878 15879 15880 15881 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15877 def subtype_to_hash { :price => price.to_hash } end |
#to_json ⇒ Object
15869 15870 15871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15869 def to_json JSON.dump(to_hash) end |