Class: TweetHose::Config
- Inherits:
-
Object
- Object
- TweetHose::Config
- Defined in:
- lib/tweethose/config.rb
Overview
Configures TweetHose
Class Method Summary collapse
-
.on_delete_tweet(&block) ⇒ Object
Block to call when a delete tweet arrives from Twitter.
-
.on_error(&block) ⇒ Object
Block to call when a error is returned from Twitter.
-
.on_new_tweet(&block) ⇒ Object
Block to call when a new tweet arrives.
-
.password ⇒ Object
Gets the password.
-
.password=(password) ⇒ Object
Sets the Twitter password.
-
.track_keywords ⇒ Object
Gets the currently tracked keywords.
-
.track_keywords=(array) ⇒ Object
Sets the keywords to track from Twitter.
-
.username ⇒ Object
Gets the username.
-
.username=(username) ⇒ Object
Sets the Twitter username.
Class Method Details
.on_delete_tweet(&block) ⇒ Object
Block to call when a delete tweet arrives from Twitter. The tweet id to delete will be given as a parameter to the block.
64 65 66 67 68 69 70 71 |
# File 'lib/tweethose/config.rb', line 64 def self.on_delete_tweet &block if block_given? @on_delete_tweet = block self else @on_delete_tweet end end |
.on_error(&block) ⇒ Object
Block to call when a error is returned from Twitter. The message will be given as a parameter to the block.
76 77 78 79 80 81 82 83 |
# File 'lib/tweethose/config.rb', line 76 def self.on_error &block if block_given? @on_error = block self else @on_error end end |
.on_new_tweet(&block) ⇒ Object
Block to call when a new tweet arrives. The new tweet will be given as a parameter to the block.
52 53 54 55 56 57 58 59 |
# File 'lib/tweethose/config.rb', line 52 def self.on_new_tweet &block if block_given? @on_new_tweet = block self else @on_new_tweet end end |
.password ⇒ Object
Gets the password
31 32 33 |
# File 'lib/tweethose/config.rb', line 31 def self.password @password end |
.password=(password) ⇒ Object
Sets the Twitter password
24 25 26 |
# File 'lib/tweethose/config.rb', line 24 def self.password=(password) @password = password end |
.track_keywords ⇒ Object
Gets the currently tracked keywords
45 46 47 |
# File 'lib/tweethose/config.rb', line 45 def self.track_keywords @track_keywords end |
.track_keywords=(array) ⇒ Object
Sets the keywords to track from Twitter.
38 39 40 |
# File 'lib/tweethose/config.rb', line 38 def self.track_keywords=(array) @track_keywords = array end |
.username ⇒ Object
Gets the username
17 18 19 |
# File 'lib/tweethose/config.rb', line 17 def self.username @username end |
.username=(username) ⇒ Object
Sets the Twitter username
10 11 12 |
# File 'lib/tweethose/config.rb', line 10 def self.username=(username) @username = username end |