Module: Orkut::Authenticatable

Included in:
API
Defined in:
lib/orkut/authenticatable.rb

Instance Method Summary collapse

Instance Method Details

#authenticated?Boolean

Check whether user is authenticated

Returns:

  • (Boolean)


28
29
30
# File 'lib/orkut/authenticatable.rb', line 28

def authenticated?
  credentials.values.all?
end

#authenticated_v1?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/orkut/authenticatable.rb', line 32

def authenticated_v1?
  credentials_v1.values.all?
end

#credentialsObject



16
17
18
19
20
21
22
23
# File 'lib/orkut/authenticatable.rb', line 16

def credentials
  {
    :refresh_token => refresh_token,
    :access_token => access_token,
    :expires_in => expires_in,
    :issued_at => issued_at
  }
end

#credentials_v1Hash

Credentials hash

Returns:

  • (Hash)


7
8
9
10
11
12
13
14
# File 'lib/orkut/authenticatable.rb', line 7

def credentials_v1
  {
    :consumer_key => consumer_key,
    :consumer_secret => consumer_secret,
    :token => oauth_token,
    :token_secret => oauth_token_secret
  }
end