Class: RailsInformant::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_informant/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, attributes, env: nil, fingerprint: nil) ⇒ Event

Returns a new instance of Event.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rails_informant/event.rb', line 6

def initialize(error, attributes, env: nil, fingerprint: nil)
  @error = error
  @error_class = attributes[:error_class]
  @message = attributes[:message]
  @severity = attributes[:severity]
  @controller_action = attributes[:controller_action]
  @job_class = attributes[:job_class]
  @request_path = env&.dig("PATH_INFO")
  @fingerprint = fingerprint
  @halted = false
end

Instance Attribute Details

#controller_actionObject (readonly)

Returns the value of attribute controller_action.



3
4
5
# File 'lib/rails_informant/event.rb', line 3

def controller_action
  @controller_action
end

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/rails_informant/event.rb', line 3

def error
  @error
end

#error_classObject (readonly)

Returns the value of attribute error_class.



3
4
5
# File 'lib/rails_informant/event.rb', line 3

def error_class
  @error_class
end

#fingerprintObject

Returns the value of attribute fingerprint.



4
5
6
# File 'lib/rails_informant/event.rb', line 4

def fingerprint
  @fingerprint
end

#job_classObject (readonly)

Returns the value of attribute job_class.



3
4
5
# File 'lib/rails_informant/event.rb', line 3

def job_class
  @job_class
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/rails_informant/event.rb', line 3

def message
  @message
end

#request_pathObject (readonly)

Returns the value of attribute request_path.



3
4
5
# File 'lib/rails_informant/event.rb', line 3

def request_path
  @request_path
end

#severityObject

Returns the value of attribute severity.



4
5
6
# File 'lib/rails_informant/event.rb', line 4

def severity
  @severity
end

Instance Method Details

#halt!Object



18
19
20
# File 'lib/rails_informant/event.rb', line 18

def halt!
  @halted = true
end

#halted?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rails_informant/event.rb', line 22

def halted?
  @halted
end