Class: Faye::WebSocket::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/faye/util/web_socket/api.rb

Constant Summary collapse

CAPTURING_PHASE =
1
AT_TARGET =
2
BUBBLING_PHASE =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type, options = {}) ⇒ Event

Returns a new instance of Event.



81
82
83
84
85
86
87
# File 'lib/faye/util/web_socket/api.rb', line 81

def initialize(event_type, options = {})
  @type = event_type
  metaclass = (class << self ; self ; end)
  options.each do |key, value|
    metaclass.__send__(:define_method, key) { value }
  end
end

Instance Attribute Details

#bubblesObject (readonly)

Returns the value of attribute bubbles.



74
75
76
# File 'lib/faye/util/web_socket/api.rb', line 74

def bubbles
  @bubbles
end

#cancelableObject (readonly)

Returns the value of attribute cancelable.



74
75
76
# File 'lib/faye/util/web_socket/api.rb', line 74

def cancelable
  @cancelable
end

#current_targetObject

Returns the value of attribute current_target.



75
76
77
# File 'lib/faye/util/web_socket/api.rb', line 75

def current_target
  @current_target
end

#dataObject

Returns the value of attribute data.



75
76
77
# File 'lib/faye/util/web_socket/api.rb', line 75

def data
  @data
end

#event_phaseObject

Returns the value of attribute event_phase.



75
76
77
# File 'lib/faye/util/web_socket/api.rb', line 75

def event_phase
  @event_phase
end

#targetObject

Returns the value of attribute target.



75
76
77
# File 'lib/faye/util/web_socket/api.rb', line 75

def target
  @target
end

#typeObject (readonly)

Returns the value of attribute type.



74
75
76
# File 'lib/faye/util/web_socket/api.rb', line 74

def type
  @type
end

Instance Method Details

#init_event(event_type, can_bubble, cancelable) ⇒ Object



89
90
91
92
93
# File 'lib/faye/util/web_socket/api.rb', line 89

def init_event(event_type, can_bubble, cancelable)
  @type       = event_type
  @bubbles    = can_bubble
  @cancelable = cancelable
end

#prevent_defaultObject



98
99
# File 'lib/faye/util/web_socket/api.rb', line 98

def prevent_default
end

#stop_propagationObject



95
96
# File 'lib/faye/util/web_socket/api.rb', line 95

def stop_propagation
end