Class: Caw::Mimic

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

Overview

class TwitterStream

Constant Summary collapse

VOICES =
%w(Bruce Fred Junior Ralph)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.mimicObject



92
93
94
# File 'lib/caw.rb', line 92

def self.mimic
  @mimic ||= new
end

.say(tweet) ⇒ Object



87
88
89
90
# File 'lib/caw.rb', line 87

def self.say(tweet)
  mimic.announce(tweet)
  mimic.mimic(tweet)
end

Instance Method Details

#announce(tweet) ⇒ Object



98
99
100
# File 'lib/caw.rb', line 98

def announce(tweet)
  say(tweet.from_user)
end

#mimic(tweet) ⇒ Object



102
103
104
# File 'lib/caw.rb', line 102

def mimic(tweet)
  say(tweet.text, voice_for(tweet.from_user))
end