Module: Tr3llo::API::Token

Extended by:
Token
Included in:
Token
Defined in:
lib/3llo/api/token.rb

Instance Method Summary collapse

Instance Method Details

#api_keyObject

[View source]

18
19
20
# File 'lib/3llo/api/token.rb', line 18

def api_key
  Application.fetch_configuration!().api_key
end

#api_tokenObject

[View source]

22
23
24
# File 'lib/3llo/api/token.rb', line 22

def api_token
  Application.fetch_configuration!().api_token
end

#clientObject

[View source]

14
15
16
# File 'lib/3llo/api/token.rb', line 14

def client
  Application.fetch_client!()
end

#verify(key, token) ⇒ Object

[View source]

6
7
8
9
10
11
12
# File 'lib/3llo/api/token.rb', line 6

def verify(key, token)
  client.get("/tokens/#{token}?key=#{key}", {})

  true
rescue RemoteServer::RequestError
  false
end