Class: Ejaydj::Djs::TwitterBot
- Inherits:
-
Ejaydj::Dj
- Object
- Ejaydj::Dj
- Ejaydj::Djs::TwitterBot
- Defined in:
- lib/ejaydj/djs/twitter_bot.rb
Constant Summary collapse
- MAX_SONG_LENGTH =
40
- MAX_ARTIST_LENGTH =
40
Constants inherited from Ejaydj::Dj
Instance Attribute Summary collapse
-
#twitter_access_token ⇒ Object
Returns the value of attribute twitter_access_token.
-
#twitter_access_token_secret ⇒ Object
Returns the value of attribute twitter_access_token_secret.
-
#twitter_client ⇒ Object
writeonly
Sets the attribute twitter_client.
-
#twitter_consumer_key ⇒ Object
Returns the value of attribute twitter_consumer_key.
-
#twitter_consumer_secret ⇒ Object
Returns the value of attribute twitter_consumer_secret.
Attributes inherited from Ejaydj::Dj
#late_night_playlists, #morning_playlists, #music_client_id, #music_client_secret, #music_user_id, #night_playlists, #noon_playlists
Instance Method Summary collapse
-
#initialize(attributes = {}, &block) ⇒ TwitterBot
constructor
A new instance of TwitterBot.
- #tweet_me_a_song(time: Time.now) ⇒ Object
Methods inherited from Ejaydj::Dj
#play_me_a_song, #playlists, #reload!
Constructor Details
#initialize(attributes = {}, &block) ⇒ TwitterBot
Returns a new instance of TwitterBot.
16 17 18 |
# File 'lib/ejaydj/djs/twitter_bot.rb', line 16 def initialize(attributes={}, &block) super(attributes, &block) end |
Instance Attribute Details
#twitter_access_token ⇒ Object
Returns the value of attribute twitter_access_token.
7 8 9 |
# File 'lib/ejaydj/djs/twitter_bot.rb', line 7 def twitter_access_token @twitter_access_token end |
#twitter_access_token_secret ⇒ Object
Returns the value of attribute twitter_access_token_secret.
7 8 9 |
# File 'lib/ejaydj/djs/twitter_bot.rb', line 7 def twitter_access_token_secret @twitter_access_token_secret end |
#twitter_client=(value) ⇒ Object
Sets the attribute twitter_client
7 8 9 |
# File 'lib/ejaydj/djs/twitter_bot.rb', line 7 def twitter_client=(value) @twitter_client = value end |
#twitter_consumer_key ⇒ Object
Returns the value of attribute twitter_consumer_key.
7 8 9 |
# File 'lib/ejaydj/djs/twitter_bot.rb', line 7 def twitter_consumer_key @twitter_consumer_key end |
#twitter_consumer_secret ⇒ Object
Returns the value of attribute twitter_consumer_secret.
7 8 9 |
# File 'lib/ejaydj/djs/twitter_bot.rb', line 7 def twitter_consumer_secret @twitter_consumer_secret end |
Instance Method Details
#tweet_me_a_song(time: Time.now) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/ejaydj/djs/twitter_bot.rb', line 20 def tweet_me_a_song(time: Time.now) @song = play_me_a_song(time: time) tweet = tweet_string twitter_client.update(tweet) {message: tweet, song: @song} end |