Class: Faye::WebSocket::API::Event
- Inherits:
-
Object
- Object
- Faye::WebSocket::API::Event
- Defined in:
- lib/faye/websocket/api/event.rb
Direct Known Subclasses
Constant Summary collapse
- CAPTURING_PHASE =
1
- AT_TARGET =
2
- BUBBLING_PHASE =
3
Instance Attribute Summary collapse
-
#bubbles ⇒ Object
readonly
Returns the value of attribute bubbles.
-
#cancelable ⇒ Object
readonly
Returns the value of attribute cancelable.
-
#current_target ⇒ Object
Returns the value of attribute current_target.
-
#event_phase ⇒ Object
Returns the value of attribute event_phase.
-
#target ⇒ Object
Returns the value of attribute target.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #init_event(event_type, can_bubble, cancelable) ⇒ Object
-
#initialize(event_type, options) ⇒ Event
constructor
A new instance of Event.
- #prevent_default ⇒ Object
- #stop_propagation ⇒ Object
Constructor Details
#initialize(event_type, options) ⇒ Event
Returns a new instance of Event.
11 12 13 14 |
# File 'lib/faye/websocket/api/event.rb', line 11 def initialize(event_type, ) @type = event_type .each { |key, value| instance_variable_set("@#{ key }", value) } end |
Instance Attribute Details
#bubbles ⇒ Object (readonly)
Returns the value of attribute bubbles.
4 5 6 |
# File 'lib/faye/websocket/api/event.rb', line 4 def bubbles @bubbles end |
#cancelable ⇒ Object (readonly)
Returns the value of attribute cancelable.
4 5 6 |
# File 'lib/faye/websocket/api/event.rb', line 4 def cancelable @cancelable end |
#current_target ⇒ Object
Returns the value of attribute current_target.
5 6 7 |
# File 'lib/faye/websocket/api/event.rb', line 5 def current_target @current_target end |
#event_phase ⇒ Object
Returns the value of attribute event_phase.
5 6 7 |
# File 'lib/faye/websocket/api/event.rb', line 5 def event_phase @event_phase end |
#target ⇒ Object
Returns the value of attribute target.
5 6 7 |
# File 'lib/faye/websocket/api/event.rb', line 5 def target @target end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/faye/websocket/api/event.rb', line 4 def type @type end |
Class Method Details
Instance Method Details
#init_event(event_type, can_bubble, cancelable) ⇒ Object
16 17 18 19 20 |
# File 'lib/faye/websocket/api/event.rb', line 16 def init_event(event_type, can_bubble, cancelable) @type = event_type @bubbles = can_bubble @cancelable = cancelable end |
#prevent_default ⇒ Object
25 26 |
# File 'lib/faye/websocket/api/event.rb', line 25 def prevent_default end |
#stop_propagation ⇒ Object
22 23 |
# File 'lib/faye/websocket/api/event.rb', line 22 def stop_propagation end |