Class: Io::Flow::V0::Models::AccountReference

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

Returns a new instance of AccountReference.



28896
28897
28898
28899
28900
28901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28896

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

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency.



28894
28895
28896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28894

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



28894
28895
28896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28894

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28907
28908
28909
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28907

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

#to_hashObject



28911
28912
28913
28914
28915
28916
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28911

def to_hash
  {
    :id => id,
    :currency => currency
  }
end

#to_jsonObject



28903
28904
28905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28903

def to_json
  JSON.dump(to_hash)
end