Class: Io::Flow::V0::Models::EmergencySituationSurchargeRatecardFee

Inherits:
RatecardFee
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from RatecardFee

#discriminator

Instance Method Summary collapse

Methods inherited from RatecardFee

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ EmergencySituationSurchargeRatecardFee

Returns a new instance of EmergencySituationSurchargeRatecardFee.



30723
30724
30725
30726
30727
30728
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30723

def initialize(incoming={})
  super(:discriminator => RatecardFee::Types::EMERGENCY_SITUATION_SURCHARGE_RATECARD_FEE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:amount], 'EmergencySituationSurchargeRatecardFee')
  @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

#amountObject (readonly)

Returns the value of attribute amount.



30721
30722
30723
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30721

def amount
  @amount
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30734
30735
30736
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30734

def copy(incoming={})
  EmergencySituationSurchargeRatecardFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



30738
30739
30740
30741
30742
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30738

def subtype_to_hash
  {
    :amount => amount.to_hash
  }
end

#to_jsonObject



30730
30731
30732
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30730

def to_json
  JSON.dump(to_hash)
end