Class: RTM::API::Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/rtmilk/api.rb

Overview

rtm.auth API.

Constant Summary collapse

METHOD =
'rtm.auth'

Class Method Summary collapse

Class Method Details

.checkToken(token) ⇒ Object

see spec.



112
113
114
115
116
117
# File 'lib/rtmilk/api.rb', line 112

def Auth.checkToken(token)
   p = API.params.dup
   p['method'] = METHOD + '.checkToken'
   p['auth_token'] = token
   res = API.request(API.uri_req(p))
end

.getFrobObject

see spec.



120
121
122
123
124
125
126
# File 'lib/rtmilk/api.rb', line 120

def Auth.getFrob
   p = API.params.dup
   p['method'] = METHOD + '.getFrob'

   res = API.request(API.uri_req(p))
   res['frob'].first
end

.getToken(frob) ⇒ Object



129
130
131
132
133
134
135
136
# File 'lib/rtmilk/api.rb', line 129

def Auth.getToken(frob)
   p = API.params.dup
   p['method'] = METHOD + '.getToken'
   p['frob']   = frob

   res = API.request(API.uri_req(p))
   res['auth'].first['token'].first
end