Class: OAuth::Token

Inherits:
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, #generate_key, #generate_timestamp, #normalize, #parse_header, #stringify_keys, #unescape

Constructor Details

#initialize(token, secret) ⇒ Token

Returns a new instance of Token


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

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

Instance Attribute Details

#secretObject

Returns the value of attribute secret


6
7
8
# File 'lib/oauth/tokens/token.rb', line 6

def secret
  @secret
end

#tokenObject

Returns the value of attribute token


6
7
8
# File 'lib/oauth/tokens/token.rb', line 6

def token
  @token
end

Instance Method Details

#to_queryObject


13
14
15
# File 'lib/oauth/tokens/token.rb', line 13

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