Class: TwitterImages::Authorizer
- Inherits:
-
Object
- Object
- TwitterImages::Authorizer
- Defined in:
- lib/twitter_images/authorizer.rb
Instance Attribute Summary collapse
-
#access_secret ⇒ Object
readonly
Returns the value of attribute access_secret.
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#access_token_object ⇒ Object
readonly
Returns the value of attribute access_token_object.
-
#oauth ⇒ Object
readonly
Returns the value of attribute oauth.
-
#pin ⇒ Object
readonly
Returns the value of attribute pin.
-
#request_token ⇒ Object
readonly
Returns the value of attribute request_token.
Instance Method Summary collapse
Instance Attribute Details
#access_secret ⇒ Object (readonly)
Returns the value of attribute access_secret.
3 4 5 |
# File 'lib/twitter_images/authorizer.rb', line 3 def access_secret @access_secret end |
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/twitter_images/authorizer.rb', line 3 def access_token @access_token end |
#access_token_object ⇒ Object (readonly)
Returns the value of attribute access_token_object.
3 4 5 |
# File 'lib/twitter_images/authorizer.rb', line 3 def access_token_object @access_token_object end |
#oauth ⇒ Object (readonly)
Returns the value of attribute oauth.
3 4 5 |
# File 'lib/twitter_images/authorizer.rb', line 3 def oauth @oauth end |
#pin ⇒ Object (readonly)
Returns the value of attribute pin.
3 4 5 |
# File 'lib/twitter_images/authorizer.rb', line 3 def pin @pin end |
#request_token ⇒ Object (readonly)
Returns the value of attribute request_token.
3 4 5 |
# File 'lib/twitter_images/authorizer.rb', line 3 def request_token @request_token end |
Instance Method Details
#assign_credentials ⇒ Object
15 16 17 18 19 20 |
# File 'lib/twitter_images/authorizer.rb', line 15 def assign_credentials if File.exist?(ENV["HOME"] + "/.twitter_imagesrc") @access_token = IO.readlines(ENV["HOME"] + "/.twitter_imagesrc")[0].chomp @access_secret = IO.readlines(ENV["HOME"] + "/.twitter_imagesrc")[1].chomp end end |
#authorize ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/twitter_images/authorizer.rb', line 5 def get_request_token visit_url get_pin write_credentials assign_credentials puts "Authorization successful. Credentials have been written to #{ENV['HOME']}/.twitter_imagesrc" end |