Class: Guideline::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/guideline/checkers/checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Checker

Returns a new instance of Checker.



3
4
5
# File 'lib/guideline/checkers/checker.rb', line 3

def initialize(options = {})
  @options = options
end

Instance Method Details

#errorsObject



7
8
9
# File 'lib/guideline/checkers/checker.rb', line 7

def errors
  @errors ||= []
end

#has_error?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/guideline/checkers/checker.rb', line 19

def has_error?
  !errors.empty?
end

#report(options) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/guideline/checkers/checker.rb', line 11

def report(options)
  errors << Error.new(
    :message => options[:message],
    :path    => options[:path],
    :line    => options[:line]
  )
end