Class: Io::Flow::V0::Models::AmountMarginForm
- Inherits:
-
TierRuleOutcomeForm
- Object
- TierRuleOutcomeForm
- Io::Flow::V0::Models::AmountMarginForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#margin ⇒ Object
readonly
Returns the value of attribute margin.
Attributes inherited from TierRuleOutcomeForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AmountMarginForm
constructor
A new instance of AmountMarginForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from TierRuleOutcomeForm
Constructor Details
#initialize(incoming = {}) ⇒ AmountMarginForm
Returns a new instance of AmountMarginForm.
12659 12660 12661 12662 12663 12664 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12659 def initialize(incoming={}) super(:discriminator => TierRuleOutcomeForm::Types::AMOUNT_MARGIN_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:margin], 'AmountMarginForm') @margin = (x = opts.delete(:margin); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) end |
Instance Attribute Details
#margin ⇒ Object (readonly)
Returns the value of attribute margin.
12657 12658 12659 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12657 def margin @margin end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
12670 12671 12672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12670 def copy(incoming={}) AmountMarginForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
12674 12675 12676 12677 12678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12674 def subtype_to_hash { :margin => margin.to_hash } end |
#to_json ⇒ Object
12666 12667 12668 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12666 def to_json JSON.dump(to_hash) end |