Class: Myun2::Twitter::Authenticate
- Inherits:
-
Object
- Object
- Myun2::Twitter::Authenticate
- Defined in:
- lib/myun2/twitter/authenticate.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#authorize_url ⇒ Object
readonly
Returns the value of attribute authorize_url.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #authorize(pin_code) ⇒ Object
-
#initialize(params) ⇒ Authenticate
constructor
A new instance of Authenticate.
- #request_authorize_url ⇒ Object
Constructor Details
#initialize(params) ⇒ Authenticate
Returns a new instance of Authenticate.
8 9 10 |
# File 'lib/myun2/twitter/authenticate.rb', line 8 def initialize(params) @client = TwitterOAuth::Client.new(params) end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/myun2/twitter/authenticate.rb', line 6 def access_token @access_token end |
#authorize_url ⇒ Object (readonly)
Returns the value of attribute authorize_url.
6 7 8 |
# File 'lib/myun2/twitter/authenticate.rb', line 6 def @authorize_url end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/myun2/twitter/authenticate.rb', line 6 def client @client end |
Instance Method Details
#authorize(pin_code) ⇒ Object
17 18 19 20 |
# File 'lib/myun2/twitter/authenticate.rb', line 17 def (pin_code) @access_token = client.( @token.token, @token.secret, oauth_verifier: pin_code) end |
#request_authorize_url ⇒ Object
12 13 14 15 |
# File 'lib/myun2/twitter/authenticate.rb', line 12 def @token = client.authentication_request_token(oauth_callback: 'oob') @authorize_url = @token. end |