Class: Io::Flow::V0::Models::FuelSurchargeRatecardFee
- Inherits:
-
RatecardFee
- Object
- RatecardFee
- Io::Flow::V0::Models::FuelSurchargeRatecardFee
- 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 = {}) ⇒ FuelSurchargeRatecardFee
constructor
A new instance of FuelSurchargeRatecardFee.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from RatecardFee
Constructor Details
#initialize(incoming = {}) ⇒ FuelSurchargeRatecardFee
Returns a new instance of FuelSurchargeRatecardFee.
43905 43906 43907 43908 43909 43910 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43905 def initialize(incoming={}) super(:discriminator => RatecardFee::Types::FUEL_SURCHARGE_RATECARD_FEE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:amount], 'FuelSurchargeRatecardFee') @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.
43903 43904 43905 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43903 def amount @amount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43916 43917 43918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43916 def copy(incoming={}) FuelSurchargeRatecardFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
43920 43921 43922 43923 43924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43920 def subtype_to_hash { :amount => amount.to_hash } end |
#to_json ⇒ Object
43912 43913 43914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43912 def to_json JSON.dump(to_hash) end |