Class: Syntaxer::Checker

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Observable
Defined in:
lib/syntaxer/checker.rb

Direct Known Subclasses

PlainChecker, RepoChecker

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(syntaxer, count) ⇒ Checker

Returns a new instance of Checker.



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/syntaxer/checker.rb', line 14

def initialize(syntaxer, count)
  Printer.setup do |p|
    p.count_of_files = count
    p.mode = syntaxer.hook ? :hook : :default
  end

  add_observer(Printer)
  @syntaxer = syntaxer
  @reader = @syntaxer.reader
  @results = []
end

Instance Attribute Details

#readerObject

Returns the value of attribute reader.



12
13
14
# File 'lib/syntaxer/checker.rb', line 12

def reader
  @reader
end

#syntaxerObject

Returns the value of attribute syntaxer.



12
13
14
# File 'lib/syntaxer/checker.rb', line 12

def syntaxer
  @syntaxer
end

Class Method Details

.process(syntaxer) ⇒ RepoChecker, #process

Factory for checker

Returns:



30
31
32
33
34
35
36
# File 'lib/syntaxer/checker.rb', line 30

def self.process(syntaxer)
  if syntaxer.repository
    RepoChecker.new(syntaxer).process
  else
    PlainChecker.new(syntaxer).process
  end
end