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.



37835
37836
37837
37838
37839
37840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37835

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.



37833
37834
37835
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37833

def amount
  @amount
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37846
37847
37848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37846

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

#subtype_to_hashObject



37850
37851
37852
37853
37854
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37850

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

#to_jsonObject



37842
37843
37844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37842

def to_json
  JSON.dump(to_hash)
end