Class: CeilingCat::Plugin::TWSS
- Inherits:
-
Base
- Object
- Base
- CeilingCat::Plugin::TWSS
show all
- Defined in:
- lib/ceiling_cat/plugins/twss.rb
Constant Summary
collapse
- RESPONSES =
["That's what she said!", "Uh, that's what she said!", "TWSS", "TWSS!"]
Class Attribute Summary collapse
Attributes inherited from Base
#event
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#body, #body_without_command, #body_without_nick, #body_without_nick_or_command, commands, #commands, #initialize, #pluralize, #reply, #room, store, #store, #user, #words
Class Attribute Details
.threshold ⇒ Object
Returns the value of attribute threshold.
6
7
8
|
# File 'lib/ceiling_cat/plugins/twss.rb', line 6
def threshold
@threshold
end
|
Class Method Details
.description ⇒ Object
16
17
18
|
# File 'lib/ceiling_cat/plugins/twss.rb', line 16
def self.description
"TWSS via Bayes classifier"
end
|
.name ⇒ Object
20
21
22
|
# File 'lib/ceiling_cat/plugins/twss.rb', line 20
def self.name
"TWSS"
end
|
.public? ⇒ Boolean
24
25
26
|
# File 'lib/ceiling_cat/plugins/twss.rb', line 24
def self.public?
false
end
|
Instance Method Details
#handle ⇒ Object
9
10
11
12
13
14
|
# File 'lib/ceiling_cat/plugins/twss.rb', line 9
def handle
TWSS.threshold = self.class.threshold
if event.type == :chat && TWSS(body)
reply RESPONSES[Kernel.rand(RESPONSES.size)]
end
end
|