Module: Horse

Defined in:
lib/horse.rb,
lib/horse/tweeter.rb,
lib/horse/version.rb,
lib/horse/funny_tweet.rb,
lib/horse/pending_tweets.rb,
lib/horse/previously_made_tweets.rb

Defined Under Namespace

Modules: FunnyTweet, PendingTweets, PreviouslyMadeTweets, Tweeter

Constant Summary collapse

VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.method_to_get_tweetsObject



29
30
31
# File 'lib/horse.rb', line 29

def self.method_to_get_tweets
  @options[:pending_tweets]
end

.setup(options) ⇒ Object



6
7
8
# File 'lib/horse.rb', line 6

def self.setup options
  @options = options
end

.tweet_something_newObject



10
11
12
13
14
# File 'lib/horse.rb', line 10

def self.tweet_something_new
  funny_tweet = FunnyTweet.next
  return unless funny_tweet
  Tweeter.tweet funny_tweet
end

.twitter_clientObject



16
17
18
19
20
21
22
23
# File 'lib/horse.rb', line 16

def self.twitter_client
  @client ||= Twitter::REST::Client.new do |config|
                config.consumer_key        = @options[:consumer_key]
                config.consumer_secret     = @options[:consumer_secret]
                config.access_token        = @options[:access_token]
                config.access_token_secret = @options[:access_token_secret]
              end
end

.twitter_usernameObject



25
26
27
# File 'lib/horse.rb', line 25

def self.twitter_username
  @options[:twitter_username]
end