Class: Snitch::Services::Twitter

Inherits:
Snitch::Service show all
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

#attributes, #base

Instance Method Summary collapse

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(, 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(message)
  connection.update(message)
end