Class: Deadfire::ErrorReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/deadfire/error_reporter.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorReporter

Returns a new instance of ErrorReporter.



7
8
9
# File 'lib/deadfire/error_reporter.rb', line 7

def initialize
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



5
6
7
# File 'lib/deadfire/error_reporter.rb', line 5

def errors
  @errors
end

Instance Method Details

#error(line, message) ⇒ Object



11
12
13
14
15
# File 'lib/deadfire/error_reporter.rb', line 11

def error(line, message)
  error = Error.new(line, message)
  Deadfire.configuration.logger.error(error.to_s) unless Deadfire.configuration.supressed
  @errors << error
end

#errors?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/deadfire/error_reporter.rb', line 17

def errors?
  @errors.any?
end