Class: Io::Flow::V0::Models::AllocationCurrencies

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ AllocationCurrencies

Returns a new instance of AllocationCurrencies.



9321
9322
9323
9324
9325
9326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9321

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:base, :target], 'AllocationCurrencies')
  @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
  @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



9319
9320
9321
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9319

def base
  @base
end

#targetObject (readonly)

Returns the value of attribute target.



9319
9320
9321
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9319

def target
  @target
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



9332
9333
9334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9332

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

#to_hashObject



9336
9337
9338
9339
9340
9341
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9336

def to_hash
  {
    :base => base,
    :target => target
  }
end

#to_jsonObject



9328
9329
9330
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9328

def to_json
  JSON.dump(to_hash)
end