Class: ModSpox::Messages::Internal::TimerAdd
- Defined in:
- lib/mod_spox/messages/internal/TimerAdd.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
code block to execute.
-
#data ⇒ Object
readonly
data to supply to block.
-
#ident ⇒ Object
readonly
message identification.
-
#once ⇒ Object
readonly
only execute block once.
-
#period ⇒ Object
readonly
interval between executions.
Attributes inherited from Request
Instance Method Summary collapse
-
#id ⇒ Object
Message ID.
-
#initialize(object, period, data = nil, once = false, &block) ⇒ TimerAdd
constructor
- period
- interval between executions once
- only run block once block
-
code block Add repeating event to timer.
Constructor Details
#initialize(object, period, data = nil, once = false, &block) ⇒ TimerAdd
- period
-
interval between executions
- once
-
only run block once
- block
-
code block
Add repeating event to timer
20 21 22 23 24 25 26 27 |
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 20 def initialize(object, period, data=nil, once=false, &block) super(object) @data = data @period = period @once = once @block = block @ident = rand(99999999) end |
Instance Attribute Details
#block ⇒ Object (readonly)
code block to execute
7 8 9 |
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 7 def block @block end |
#data ⇒ Object (readonly)
data to supply to block
9 10 11 |
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 9 def data @data end |
#ident ⇒ Object (readonly)
message identification
15 16 17 |
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 15 def ident @ident end |
#once ⇒ Object (readonly)
only execute block once
13 14 15 |
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 13 def once @once end |
#period ⇒ Object (readonly)
interval between executions
11 12 13 |
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 11 def period @period end |
Instance Method Details
#id ⇒ Object
Message ID
30 31 32 |
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 30 def id @ident end |