Class: Flexo::Events::KickEvent
- Inherits:
-
Flexo::Event
- Object
- Flexo::Event
- Flexo::Events::KickEvent
- Defined in:
- lib/flexo/events/kick.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#kicker ⇒ Object
(also: #kicked_by)
readonly
Returns the value of attribute kicker.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#victim ⇒ Object
readonly
Returns the value of attribute victim.
Attributes inherited from Flexo::Event
Instance Method Summary collapse
-
#initialize(*args) ⇒ KickEvent
constructor
A new instance of KickEvent.
- #kicked_me? ⇒ Boolean
- #rejoin ⇒ Object
Methods inherited from Flexo::Event
Constructor Details
#initialize(*args) ⇒ KickEvent
Returns a new instance of KickEvent.
11 12 13 14 15 16 17 |
# File 'lib/flexo/events/kick.rb', line 11 def initialize(*args) super @kicker = @data.hostmask.nick @channel = @data.params[0] @victim = @data.params[1] @reason = @data.string end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
4 5 6 |
# File 'lib/flexo/events/kick.rb', line 4 def channel @channel end |
#kicker ⇒ Object (readonly) Also known as: kicked_by
Returns the value of attribute kicker.
5 6 7 |
# File 'lib/flexo/events/kick.rb', line 5 def kicker @kicker end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
7 8 9 |
# File 'lib/flexo/events/kick.rb', line 7 def reason @reason end |
#victim ⇒ Object (readonly)
Returns the value of attribute victim.
6 7 8 |
# File 'lib/flexo/events/kick.rb', line 6 def victim @victim end |
Instance Method Details
#kicked_me? ⇒ Boolean
19 20 21 |
# File 'lib/flexo/events/kick.rb', line 19 def kicked_me? @victim == @manager.nickname end |
#rejoin ⇒ Object
23 24 25 26 |
# File 'lib/flexo/events/kick.rb', line 23 def rejoin sleep rand*5 @manager.sender.join(@channel) end |