Class: Io::Flow::V0::Models::ServiceFee
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ServiceFee
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
DutiesTaxesPaidSurchargeServiceFee, EmergencySituationSurchargeServiceFee, FuelSurchargeAmountByWeightServiceFee, FuelSurchargeServiceFee, PeakSurchargeByWeightServiceFee, PeakSurchargeServiceFee, RemoteAreaServiceFee, ServiceFeeUndefinedType
Defined Under Namespace
Modules: Types
Instance Attribute Summary collapse
-
#discriminator ⇒ Object
readonly
Returns the value of attribute discriminator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ ServiceFee
constructor
A new instance of ServiceFee.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ServiceFee
Returns a new instance of ServiceFee.
15247 15248 15249 15250 15251 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15247 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ServiceFee') @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String) end |
Instance Attribute Details
#discriminator ⇒ Object (readonly)
Returns the value of attribute discriminator.
15245 15246 15247 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15245 def discriminator @discriminator end |
Class Method Details
.from_json(hash) ⇒ Object
Instance Method Details
#subtype_to_hash ⇒ Object
15253 15254 15255 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15253 def subtype_to_hash raise 'Cannot serialize an instance of service_fee directly - must use one of the specific types: fuel_surcharge_service_fee, fuel_surcharge_amount_by_weight_service_fee, remote_area_service_fee, emergency_situation_surcharge_service_fee, peak_surcharge_service_fee, peak_surcharge_by_weight_service_fee, duties_taxes_paid_surcharge_service_fee' end |
#to_hash ⇒ Object
15257 15258 15259 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15257 def to_hash subtype_to_hash.merge(:discriminator => @discriminator) end |