class Porteo::Twitter_gateway

Gateway to use Twitter service with Twitter gem. In Porteo this class acts as a link between any twitter protocol and Twitter gem.

This class inherits from Gateway and just overwrite the send_message method.

Public Instance Methods

send_message( msg ) click to toggle source

Send the twitt using Twitter gem. @param [Hash] msg The message sections to send @return [nil]

# File lib/gateways/twitter_gateway.rb, line 44
def send_message( msg )
  Twitter.configure do |config|
    config.consumer_key = @config[:consumer_key]
    config.consumer_secret = @config[:consumer_secret]
    config.oauth_token = @config[:oauth_token]
    config.oauth_token_secret = @config[:oauth_token_secret]
  end

 Twitter.update( msg[:body] ) 
end