Class: Syntaxer::Checker
- Inherits:
-
Object
- Object
- Syntaxer::Checker
- Extended by:
- Forwardable
- Includes:
- Observable
- Defined in:
- lib/syntaxer/checker.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#reader ⇒ Object
Returns the value of attribute reader.
-
#syntaxer ⇒ Object
Returns the value of attribute syntaxer.
Class Method Summary collapse
-
.process(syntaxer) ⇒ RepoChecker, #process
Factory for checker.
Instance Method Summary collapse
-
#initialize(syntaxer, count) ⇒ Checker
constructor
A new instance of Checker.
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
#reader ⇒ Object
Returns the value of attribute reader.
12 13 14 |
# File 'lib/syntaxer/checker.rb', line 12 def reader @reader end |
#syntaxer ⇒ Object
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
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 |