Sha256: c8eb08fafbea00a97db4b24365b7baf96b86eb632f2c7a421c3683b404c24e24

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

class Emittance::Event
  class << self
    # @return [Symbol] the identifier that can be used by the {Emittance::Broker broker} to find event handlers.
    def identifier
      Emittance::Event::EventBuilder.klass_to_identifier self
    end

    # @private
    def event_klass_for(identifier)
      Emittance::Event::EventBuilder.object_to_klass identifier
    end
  end

  attr_reader :emitter, :timestamp, :payload

  def initialize(emitter, timestamp, payload)
    @emitter = emitter
    @timestamp = timestamp
    @payload = payload
  end

  def identifier
    self.class.identifier
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
emittance-0.0.1 lib/emittance/event.rb