class Event

------------------------------------------

Event

------------------------------------------

Constants

FLAG_DEFAULT
FLAG_ERROR

Attributes

channel[R]
flag[RW]
parent[RW]
results[R]
sender[R]
time[R]

Public Class Methods

new(_sender, _args=nil) click to toggle source
# File lib/a-commons.rb, line 653
def initialize(_sender, _args=nil)
  @breaked = false
  @sender = _sender
  @channel = '0'
  @flag= FLAG_DEFAULT
  if _args
    _args.each do |key, value|
      #self.send(key, value)
      self.send(key.to_s+'=', value) if self.respond_to?(key.to_s)
    end
  end
  @time = Time.new
  @results = Array.new
end

Public Instance Methods

add_finalize_callback(_proc) click to toggle source
# File lib/a-commons.rb, line 668
def add_finalize_callback(_proc)
  ObjectSpace.define_finalizer(self, _proc)
end
add_result(_sender, _args=nil) click to toggle source
# File lib/a-commons.rb, line 672
def add_result(_sender, _args=nil)
  if self.class::Result
    res = self.class::Result.new(_sender, _args)
  else
    res = Result.new(_sender, _args)
  end
  @results << res
  res
end
break() click to toggle source
# File lib/a-commons.rb, line 686
def break
  @breaked = true
end
is_breaked?() click to toggle source
# File lib/a-commons.rb, line 682
def is_breaked?
  @breaked
end