Class: ActionController::Base
- Inherits:
-
Object
- Object
- ActionController::Base
- Defined in:
- lib/twitter_connect.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#twitter_client ⇒ Object
readonly
Returns the value of attribute twitter_client.
Instance Method Summary collapse
Instance Attribute Details
#twitter_client ⇒ Object (readonly)
Returns the value of attribute twitter_client.
43 44 45 |
# File 'lib/twitter_connect.rb', line 43 def twitter_client @twitter_client end |
Instance Method Details
#set_twitter_client ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/twitter_connect.rb', line 33 def set_twitter_client begin oauth = Twitter::OAuth.new(TwitterConnect.configuration['consumer_token'], TwitterConnect.configuration['consumer_secret']) oauth.(session[:atoken], session[:asecret]) @twitter_client = Twitter::Base.new(oauth) rescue Twitter::Unauthorized redirect_to TwitterConnect.configuration['logout_url'] || root_url end end |