Class: OAuth::Token

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/oauth/tokens/token.rb

Overview

Superclass for the various tokens used by OAuth

Direct Known Subclasses

ConsumerToken, ServerToken

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

_escape, escape, generate_key, generate_timestamp, normalize, normalize_nested_query, parse_header, stringify_keys, unescape

Constructor Details

#initialize(token, secret) ⇒ Token

Returns a new instance of Token.



10
11
12
13
# File 'lib/oauth/tokens/token.rb', line 10

def initialize(token, secret)
  @token = token
  @secret = secret
end

Instance Attribute Details

#secretObject

Returns the value of attribute secret.



8
9
10
# File 'lib/oauth/tokens/token.rb', line 8

def secret
  @secret
end

#tokenObject

Returns the value of attribute token.



8
9
10
# File 'lib/oauth/tokens/token.rb', line 8

def token
  @token
end

Instance Method Details

#to_queryObject



15
16
17
# File 'lib/oauth/tokens/token.rb', line 15

def to_query
  "oauth_token=#{escape(token)}&oauth_token_secret=#{escape(secret)}"
end