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.



46775
46776
46777
46778
46779
46780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46775

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.



46773
46774
46775
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46773

def amount
  @amount
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46786
46787
46788
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46786

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

#subtype_to_hashObject



46790
46791
46792
46793
46794
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46790

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

#to_jsonObject



46782
46783
46784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46782

def to_json
  JSON.dump(to_hash)
end