Class: Crazylegs::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/crazylegs/credentials.rb

Overview

Encapsulates a request token, which is what the server returns when you request a user’s OAuth Token

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, secret) ⇒ AccessToken

Create a new token

token

the token itself

secret

the token secret, used for signing requests

Raises:

  • (ArgumentError)


15
16
17
18
19
20
# File 'lib/crazylegs/credentials.rb', line 15

def initialize(token,secret)
  raise ArgumentError.new('token is required') if token.nil?
  raise ArgumentError.new('secret is required') if secret.nil?
  @token = token
  @secret = secret
end

Instance Attribute Details

#secretObject (readonly)

Returns the value of attribute secret.



10
11
12
# File 'lib/crazylegs/credentials.rb', line 10

def secret
  @secret
end

#tokenObject (readonly)

Returns the value of attribute token.



9
10
11
# File 'lib/crazylegs/credentials.rb', line 9

def token
  @token
end