Class: Io::Flow::V0::Models::TokenAuthenticationForm

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

Overview

Used to authenticate a given token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TokenAuthenticationForm

Returns a new instance of TokenAuthenticationForm.



26587
26588
26589
26590
26591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26587

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

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



26585
26586
26587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26585

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26597
26598
26599
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26597

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

#to_hashObject



26601
26602
26603
26604
26605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26601

def to_hash
  {
    :token => token
  }
end

#to_jsonObject



26593
26594
26595
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26593

def to_json
  JSON.dump(to_hash)
end