Class: Cliqr::Events::Event Private

Inherits:
Object
  • Object
show all
Defined in:
lib/cliqr/events/event.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defines a event and its properties

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, command, parent) ⇒ Event

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a new event



30
31
32
33
34
35
36
# File 'lib/cliqr/events/event.rb', line 30

def initialize(name, command, parent)
  @name = name
  @command = command
  @parent = parent
  @timestamp = Time.now
  @propagate = true
end

Instance Attribute Details

#commandString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Command that was first invoked which resulted in this event

Returns:

  • (String)


17
18
19
# File 'lib/cliqr/events/event.rb', line 17

def command
  @command
end

#nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Event’s name

Returns:

  • (String)


12
13
14
# File 'lib/cliqr/events/event.rb', line 12

def name
  @name
end

#parentCliqr::Events::Event (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

If this event was invoked from another event handler, this will ne non-nil



27
28
29
# File 'lib/cliqr/events/event.rb', line 27

def parent
  @parent
end

#timestampTime (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Time when the event was invoked

Returns:

  • (Time)


22
23
24
# File 'lib/cliqr/events/event.rb', line 22

def timestamp
  @timestamp
end

Instance Method Details

#parent?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check if this event has a parent event

Returns:

  • (Boolean)


39
40
41
# File 'lib/cliqr/events/event.rb', line 39

def parent?
  !parent.nil?
end

#propagate?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Control event propagation

Returns:

  • (Boolean)


44
45
46
# File 'lib/cliqr/events/event.rb', line 44

def propagate?
  @propagate
end

#stop_propagationBoolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Unset propagation bit

Returns:

  • (Boolean)


51
52
53
# File 'lib/cliqr/events/event.rb', line 51

def stop_propagation
  @propagate = false
end