Class: Faye::WebSocket::API::Event
- Inherits:
-
Object
- Object
- Faye::WebSocket::API::Event
- Defined in:
- lib/faye/websocket/api/event.rb
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.
-
#data ⇒ Object
Returns the value of attribute data.
-
#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.
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 15 16 17 |
# File 'lib/faye/websocket/api/event.rb', line 11 def initialize(event_type, = {}) @type = event_type = (class << self ; self ; end) .each do |key, value| .__send__(:define_method, key) { value } end 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 |
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/faye/websocket/api/event.rb', line 5 def data @data 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 |
Instance Method Details
#init_event(event_type, can_bubble, cancelable) ⇒ Object
19 20 21 22 23 |
# File 'lib/faye/websocket/api/event.rb', line 19 def init_event(event_type, can_bubble, cancelable) @type = event_type @bubbles = can_bubble @cancelable = cancelable end |
#prevent_default ⇒ Object
28 29 |
# File 'lib/faye/websocket/api/event.rb', line 28 def prevent_default end |
#stop_propagation ⇒ Object
25 26 |
# File 'lib/faye/websocket/api/event.rb', line 25 def stop_propagation end |