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.



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

.passwordObject

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_keywordsObject

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

.usernameObject

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