Class: Io::Flow::V0::Models::EmergencySituationSurchargeServiceFee
- Inherits:
-
ServiceFee
- Object
- ServiceFee
- Io::Flow::V0::Models::EmergencySituationSurchargeServiceFee
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#destination_region ⇒ Object
readonly
Returns the value of attribute destination_region.
-
#interval_unit ⇒ Object
readonly
Returns the value of attribute interval_unit.
-
#origin_region ⇒ Object
readonly
Returns the value of attribute origin_region.
Attributes inherited from ServiceFee
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ EmergencySituationSurchargeServiceFee
constructor
A new instance of EmergencySituationSurchargeServiceFee.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ServiceFee
Constructor Details
#initialize(incoming = {}) ⇒ EmergencySituationSurchargeServiceFee
Returns a new instance of EmergencySituationSurchargeServiceFee.
30125 30126 30127 30128 30129 30130 30131 30132 30133 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30125 def initialize(incoming={}) super(:discriminator => ServiceFee::Types::EMERGENCY_SITUATION_SURCHARGE_SERVICE_FEE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:amount], 'EmergencySituationSurchargeServiceFee') @amount = (x = opts.delete(:amount); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) @origin_region = (x = opts.delete(:origin_region); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::RatecardRegionReference) ? x : ::Io::Flow::V0::Models::RatecardRegionReference.new(x))) @destination_region = (x = opts.delete(:destination_region); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::RatecardRegionReference) ? x : ::Io::Flow::V0::Models::RatecardRegionReference.new(x))) @interval_unit = (x = opts.delete(:interval_unit); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x))) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
30123 30124 30125 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30123 def amount @amount end |
#destination_region ⇒ Object (readonly)
Returns the value of attribute destination_region.
30123 30124 30125 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30123 def destination_region @destination_region end |
#interval_unit ⇒ Object (readonly)
Returns the value of attribute interval_unit.
30123 30124 30125 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30123 def interval_unit @interval_unit end |
#origin_region ⇒ Object (readonly)
Returns the value of attribute origin_region.
30123 30124 30125 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30123 def origin_region @origin_region end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30139 30140 30141 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30139 def copy(incoming={}) EmergencySituationSurchargeServiceFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
30143 30144 30145 30146 30147 30148 30149 30150 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30143 def subtype_to_hash { :amount => amount.to_hash, :origin_region => origin_region.nil? ? nil : origin_region.to_hash, :destination_region => destination_region.nil? ? nil : destination_region.to_hash, :interval_unit => interval_unit.nil? ? nil : interval_unit.value } end |
#to_json ⇒ Object
30135 30136 30137 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30135 def to_json JSON.dump(to_hash) end |