Class: Io::Flow::V0::Models::RemoteAreaRatecardFee

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 = {}) ⇒ RemoteAreaRatecardFee

Returns a new instance of RemoteAreaRatecardFee.



45332
45333
45334
45335
45336
45337
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45332

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



45330
45331
45332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45330

def amount
  @amount
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



45343
45344
45345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45343

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

#subtype_to_hashObject



45347
45348
45349
45350
45351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45347

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

#to_jsonObject



45339
45340
45341
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45339

def to_json
  JSON.dump(to_hash)
end