Class: Io::Flow::V0::Models::CrossdockRatecardFee
- Inherits:
-
RatecardFee
- Object
- RatecardFee
- Io::Flow::V0::Models::CrossdockRatecardFee
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
Attributes inherited from RatecardFee
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CrossdockRatecardFee
constructor
A new instance of CrossdockRatecardFee.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from RatecardFee
Constructor Details
#initialize(incoming = {}) ⇒ CrossdockRatecardFee
Returns a new instance of CrossdockRatecardFee.
32765 32766 32767 32768 32769 32770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32765 def initialize(incoming={}) super(:discriminator => RatecardFee::Types::CROSSDOCK_RATECARD_FEE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:amount], 'CrossdockRatecardFee') @amount = (x = opts.delete(:amount); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
32763 32764 32765 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32763 def amount @amount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32776 32777 32778 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32776 def copy(incoming={}) CrossdockRatecardFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
32780 32781 32782 32783 32784 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32780 def subtype_to_hash { :amount => amount.to_hash } end |
#to_json ⇒ Object
32772 32773 32774 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32772 def to_json JSON.dump(to_hash) end |