Class: Io::Flow::V0::Models::RemoteAreaServiceFee

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

Instance Attribute Summary collapse

Attributes inherited from ServiceFee

#discriminator

Instance Method Summary collapse

Methods inherited from ServiceFee

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ RemoteAreaServiceFee

Returns a new instance of RemoteAreaServiceFee.



42429
42430
42431
42432
42433
42434
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42429

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



42427
42428
42429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42427

def amount
  @amount
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



42440
42441
42442
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42440

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

#subtype_to_hashObject



42444
42445
42446
42447
42448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42444

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

#to_jsonObject



42436
42437
42438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42436

def to_json
  JSON.dump(to_hash)
end