Class: ClosingComments::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/closing_comments/processor.rb

Direct Known Subclasses

JSON, Reporter

Defined Under Namespace

Classes: Fixer, JSON, Reporter

Instance Method Summary collapse

Constructor Details

#initializeProcessor

Returns a new instance of Processor.



5
6
7
# File 'lib/closing_comments/processor.rb', line 5

def initialize
  @reportables = {}
end

Instance Method Details

#process(path:) ⇒ Object

TODO(marcinw): catch parsing errors;



10
11
12
13
14
# File 'lib/closing_comments/processor.rb', line 10

def process(path:)
  source = Source.from(path: path)
  handle(source)
  @reportables[path] = source if source.problematic?
end

#success?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/closing_comments/processor.rb', line 16

def success?
  @reportables.empty?
end