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.



9272
9273
9274
9275
9276
9277
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9272

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

#base ⇒ Object (readonly)

Returns the value of attribute base.



9270
9271
9272
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9270

def base
  @base
end

#target ⇒ Object (readonly)

Returns the value of attribute target.



9270
9271
9272
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9270

def target
  @target
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



9283
9284
9285
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9283

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

#to_hash ⇒ Object



9287
9288
9289
9290
9291
9292
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9287

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

#to_json ⇒ Object



9279
9280
9281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9279

def to_json
  JSON.dump(to_hash)
end