Class: Io::Flow::V0::Models::CustomerClientToken

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



27799
27800
27801
27802
27803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27799

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

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



27797
27798
27799
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27797

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



27809
27810
27811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27809

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

#to_hashObject



27813
27814
27815
27816
27817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27813

def to_hash
  {
    :token => token
  }
end

#to_jsonObject



27805
27806
27807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27805

def to_json
  JSON.dump(to_hash)
end