Sha256: 4fc0506c4561c30a0c5fa8a6ceee6bbce42262916f673d035f1618202e7a433f

Contents?: true

Size: 629 Bytes

Versions: 34

Compression:

Stored size: 629 Bytes

Contents

module Celluloid
  # Wraps all events and context for a single incident.
  class Incident
    attr_accessor :pid
    attr_accessor :events, :triggering_event

    def initialize(events, triggering_event=nil)
      @events = events
      @triggering_event = triggering_event
      @pid = $$
    end

    # Merge two incidents together. This may be useful if two incidents occur at the same time.
    def merge(*other_incidents)
      merged_events = other_incidents.flatten.inject(events) do |events, incident|
        events += incident.events
      end
      Incident.new(merged_events.sort, triggering_event)
    end
  end
end

Version data entries

34 entries across 32 versions & 7 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/celluloid-0.16.0/lib/celluloid/logging/incident.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/celluloid-0.16.0/lib/celluloid/logging/incident.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/celluloid-0.16.0/lib/celluloid/logging/incident.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/celluloid-0.16.0/lib/celluloid/logging/incident.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/celluloid-0.16.0/lib/celluloid/logging/incident.rb
celluloid-essentials-0.20.0.pre14 lib/celluloid/logging/incident.rb
celluloid-essentials-0.20.0.pre13 lib/celluloid/logging/incident.rb
celluloid-essentials-0.20.0.pre12 lib/celluloid/logging/incident.rb
celluloid-0.16.0 lib/celluloid/logging/incident.rb
celluloid-0.16.0.pre3 lib/celluloid/logging/incident.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/logging/incident.rb
celluloid-0.16.0.pre2 lib/celluloid/logging/incident.rb
celluloid-0.16.0.pre lib/celluloid/logging/incident.rb
celluloid-0.15.2 lib/celluloid/logging/incident.rb
celluloid-0.15.1 lib/celluloid/logging/incident.rb
celluloid-0.15.0 lib/celluloid/logging/incident.rb
celluloid-0.15.0.pre2 lib/celluloid/logging/incident.rb
celluloid-0.15.0.pre lib/celluloid/logging/incident.rb
celluloid-0.14.1 lib/celluloid/logging/incident.rb
celluloid-0.14.1.pre lib/celluloid/logging/incident.rb