Class: Snitch::Services::Twitter
- Inherits:
-
Snitch::Service
- Object
- Snitch::Service
- Snitch::Services::Twitter
- Defined in:
- lib/snitch/services/twitter.rb
Overview
Allows for using the twitter api to post a commit message update.
Instance Attribute Summary
Attributes inherited from Snitch::Service
Instance Method Summary collapse
-
#connection(force = false) ⇒ Object
Logs into twitter.
-
#tattle(message) ⇒ Object
Posts a given message to twitter using the connection method.
Methods inherited from Snitch::Service
#initialize, #method_missing, new_from_name
Constructor Details
This class inherits a constructor from Snitch::Service
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Snitch::Service
Instance Method Details
#connection(force = false) ⇒ Object
Logs into twitter.
11 12 13 14 |
# File 'lib/snitch/services/twitter.rb', line 11 def connection(force=false) @twitter = ::Twitter::Base.new(login, password) if @twitter.nil? || force @twitter end |
#tattle(message) ⇒ Object
Posts a given message to twitter using the connection method.
17 18 19 |
# File 'lib/snitch/services/twitter.rb', line 17 def tattle() connection.update() end |