Class: Flagit::Postman

Inherits:
Object
  • Object
show all
Defined in:
lib/flagit/postman.rb

Class Method Summary collapse

Class Method Details

.tweet(message) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/flagit/postman.rb', line 5

def self.tweet(message)
  auth_client = Flagit::TwitterOAuth.new
  auth_client.run_auth_process
  twitter_rest_client = Twitter::REST::Client.new(
    consumer_key: Flagit.configuration.consumer_key,
    consumer_secret: Flagit.configuration.consumer_secret,
    access_token: Flagit.configuration.access_token,
    access_token_secret: Flagit.configuration.access_token_secret
  )
  twitter_rest_client.update(message)
  puts "Tweeted: #{message}"
end