Class: Noti::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/noti/token.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#redirect_urlObject

Returns the value of attribute redirect_url.



4
5
6
# File 'lib/noti/token.rb', line 4

def redirect_url
  @redirect_url
end

#request_tokenObject

Returns the value of attribute request_token.



4
5
6
# File 'lib/noti/token.rb', line 4

def request_token
  @request_token
end

Class Method Details

.create_request_token(redirect_url) ⇒ Object



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

def self.create_request_token(redirect_url)
  request = Noti::Request.request("request_access", :app => Noti.app, :redirect_url => redirect_url)
  token = self.new
  token.request_token = request['request_token']
  token.redirect_url = request['redirect_url']
  token
end

.get_access_token(request_token) ⇒ Object



14
15
16
17
# File 'lib/noti/token.rb', line 14

def self.get_access_token(request_token)
  request = Noti::Request.request("get_access_token", :app => Noti.app, :request_token => request_token)
  request['access_token']
end