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)


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

def has_error?
  !errors.empty?
end

#report(options) ⇒ Object



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

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