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.
38836 38837 38838 38839 38840 38841 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38836 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.
38834 38835 38836 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38834 def amount @amount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38847 38848 38849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38847 def copy(incoming={}) FuelSurchargeRatecardFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
38851 38852 38853 38854 38855 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38851 def subtype_to_hash { :amount => amount.to_hash } end |
#to_json ⇒ Object
38843 38844 38845 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38843 def to_json JSON.dump(to_hash) end |