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.
-
#zero_amount_indicator ⇒ Object
readonly
Returns the value of attribute zero_amount_indicator.
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.
33774 33775 33776 33777 33778 33779 33780 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33774 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)) @zero_amount_indicator = (x = opts.delete(:zero_amount_indicator); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ZeroAmountIndicator) ? x : ::Io::Flow::V0::Models::ZeroAmountIndicator.apply(x))) end |
Instance Attribute Details
#price ⇒ Object (readonly)
Returns the value of attribute price.
33772 33773 33774 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33772 def price @price end |
#zero_amount_indicator ⇒ Object (readonly)
Returns the value of attribute zero_amount_indicator.
33772 33773 33774 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33772 def zero_amount_indicator @zero_amount_indicator end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33786 33787 33788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33786 def copy(incoming={}) FlatRateForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
33790 33791 33792 33793 33794 33795 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33790 def subtype_to_hash { :price => price.to_hash, :zero_amount_indicator => zero_amount_indicator.nil? ? nil : zero_amount_indicator.value } end |
#to_json ⇒ Object
33782 33783 33784 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33782 def to_json JSON.dump(to_hash) end |