Class: TweetHose::Config

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

Overview

Configures TweetHose

Class Method Summary collapse

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.



37
38
39
40
41
42
43
44
# File 'lib/tweethose/config.rb', line 37

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.



49
50
51
52
53
54
55
56
# File 'lib/tweethose/config.rb', line 49

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.



25
26
27
28
29
30
31
32
# File 'lib/tweethose/config.rb', line 25

def self.on_new_tweet &block
  if block_given?
    @on_new_tweet = block
    self
  else
    @on_new_tweet
  end
end

.track_keywordsObject

Gets the currently tracked keywords



18
19
20
# File 'lib/tweethose/config.rb', line 18

def self.track_keywords
  @track_keywords
end

.track_keywords=(array) ⇒ Object

Sets the keywords to track from Twitter.



11
12
13
# File 'lib/tweethose/config.rb', line 11

def self.track_keywords=(array)
@track_keywords = array
end