Module: Databasedotcom::OAuth2::Helpers

Defined in:
lib/databasedotcom-oauth2.rb

Instance Method Summary collapse

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/databasedotcom-oauth2.rb', line 80

def authenticated?
  !unauthenticated?
end

#clientObject



68
69
70
# File 'lib/databasedotcom-oauth2.rb', line 68

def client
  env['databasedotcom.client']
end

#meObject



84
85
86
87
# File 'lib/databasedotcom-oauth2.rb', line 84

def me
  @me ||= ::Hashie::Mash.new(Databasedotcom::Chatter::User.find(client, "me").raw_hash)
  #@me.organization_id
end

#tokenObject



72
73
74
# File 'lib/databasedotcom-oauth2.rb', line 72

def token
  env['databasedotcom.token']
end

#unauthenticated?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/databasedotcom-oauth2.rb', line 76

def unauthenticated?
  client.nil?
end