Sha256: c1d77cb2e299f7e9d84d1458a58622301fdc93bc89edefe7cba17f75f058bdd8

Contents?: true

Size: 692 Bytes

Versions: 2

Compression:

Stored size: 692 Bytes

Contents

module Faye::WebSocket::API
  class Event

    attr_reader   :type, :bubbles, :cancelable
    attr_accessor :target, :current_target, :event_phase, :data

    CAPTURING_PHASE = 1
    AT_TARGET       = 2
    BUBBLING_PHASE  = 3

    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

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

    def stop_propagation
    end

    def prevent_default
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
faye-websocket-0.4.7-java lib/faye/websocket/api/event.rb
faye-websocket-0.4.7 lib/faye/websocket/api/event.rb