Class: Cliqr::Events::Event Private
- Inherits:
-
Object
- Object
- Cliqr::Events::Event
- 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
-
#command ⇒ String
readonly
private
Command that was first invoked which resulted in this event.
-
#name ⇒ String
readonly
private
Event’s name.
-
#parent ⇒ Cliqr::Events::Event
readonly
private
If this event was invoked from another event handler, this will ne non-nil.
-
#timestamp ⇒ Time
readonly
private
Time when the event was invoked.
Instance Method Summary collapse
-
#initialize(name, command, parent) ⇒ Event
constructor
private
Create a new event.
-
#parent? ⇒ Boolean
private
Check if this event has a parent event.
-
#propagate? ⇒ Boolean
private
Control event propagation.
-
#stop_propagation ⇒ Boolean
private
Unset propagation bit.
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
#command ⇒ String (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
17 18 19 |
# File 'lib/cliqr/events/event.rb', line 17 def command @command end |
#name ⇒ String (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
12 13 14 |
# File 'lib/cliqr/events/event.rb', line 12 def name @name end |
#parent ⇒ Cliqr::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 |
#timestamp ⇒ Time (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
22 23 24 |
# File 'lib/cliqr/events/event.rb', line 22 def @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
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
44 45 46 |
# File 'lib/cliqr/events/event.rb', line 44 def propagate? @propagate end |
#stop_propagation ⇒ 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.
Unset propagation bit
51 52 53 |
# File 'lib/cliqr/events/event.rb', line 51 def stop_propagation @propagate = false end |