Class: SocialPoster::Poster::Twitter

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/social_poster/poster/twitter.rb

Instance Method Summary collapse

Methods included from Helper

#config_key

Constructor Details

#initializeTwitter

Returns a new instance of Twitter.



9
10
11
12
13
14
15
16
# File 'lib/social_poster/poster/twitter.rb', line 9

def initialize
  ::Twitter.configure do |config|
    config.consumer_key       = config_key :consumer_key
    config.consumer_secret    = config_key :consumer_secret
    config.oauth_token        = config_key :oauth_token
    config.oauth_token_secret = config_key :oauth_token_secret
  end
end

Instance Method Details

#write(text, title) ⇒ Object



18
19
20
# File 'lib/social_poster/poster/twitter.rb', line 18

def write(text, title)
  ::Twitter.update(text)
end