Class: ModSpox::Messages::Internal::TimerAdd

Inherits:
Request
  • Object
show all
Defined in:
lib/mod_spox/messages/internal/TimerAdd.rb

Instance Attribute Summary collapse

Attributes inherited from Request

#requester

Instance Method Summary collapse

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

#blockObject (readonly)

code block to execute



7
8
9
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 7

def block
  @block
end

#dataObject (readonly)

data to supply to block



9
10
11
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 9

def data
  @data
end

#identObject (readonly)

message identification



15
16
17
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 15

def ident
  @ident
end

#onceObject (readonly)

only execute block once



13
14
15
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 13

def once
  @once
end

#periodObject (readonly)

interval between executions



11
12
13
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 11

def period
  @period
end

Instance Method Details

#idObject

Message ID



30
31
32
# File 'lib/mod_spox/messages/internal/TimerAdd.rb', line 30

def id
    @ident
end