Class: Io::Flow::V0::Models::FuelSurchargeServiceFee
- Inherits:
-
ServiceFee
- Object
- ServiceFee
- Io::Flow::V0::Models::FuelSurchargeServiceFee
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#percent ⇒ Object
readonly
Returns the value of attribute percent.
Attributes inherited from ServiceFee
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FuelSurchargeServiceFee
constructor
A new instance of FuelSurchargeServiceFee.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ServiceFee
Constructor Details
#initialize(incoming = {}) ⇒ FuelSurchargeServiceFee
Returns a new instance of FuelSurchargeServiceFee.
43932 43933 43934 43935 43936 43937 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43932 def initialize(incoming={}) super(:discriminator => ServiceFee::Types::FUEL_SURCHARGE_SERVICE_FEE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:percent], 'FuelSurchargeServiceFee') @percent = HttpClient::Preconditions.assert_class('percent', HttpClient::Helper.to_big_decimal(opts.delete(:percent)), BigDecimal) end |
Instance Attribute Details
#percent ⇒ Object (readonly)
Returns the value of attribute percent.
43930 43931 43932 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43930 def percent @percent end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43943 43944 43945 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43943 def copy(incoming={}) FuelSurchargeServiceFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
43947 43948 43949 43950 43951 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43947 def subtype_to_hash { :percent => percent.to_f.to_s } end |
#to_json ⇒ Object
43939 43940 43941 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43939 def to_json JSON.dump(to_hash) end |