Sha256: 391fc985c219c99c2937f134026f838b8ccfb0550a863af39fb3d6d090601224

Contents?: true

Size: 445 Bytes

Versions: 5

Compression:

Stored size: 445 Bytes

Contents

module Euston
  class EventHeaders
    attr_reader :id, :type, :version, :timestamp, :command

    def initialize id, type, version, timestamp = Time.now, command = nil
      @id = id
      @type = type
      @version = version
      @timestamp = Time.at(timestamp).utc
      @command = command
    end

    def self.from_hash hash
      self.new hash[:id], hash[:type].to_sym, hash[:version], hash[:timestamp], hash[:command]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
euston-1.1.0 lib/euston/event_headers.rb
euston-1.1.0-java lib/euston/event_headers.rb
euston-1.0.1 lib/euston/event_headers.rb
euston-1.0.1-java lib/euston/event_headers.rb
euston-1.0.0 lib/euston/event_headers.rb