Class: Yardstick::Processor

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

Overview

Handle procesing a docstring or path of files

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes new Processor instance

Parameters:



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

def initialize(config)
  @config = config
end

Instance Method Details

#processYardstick::MeasurementSet

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Measure files specified in the config

Returns:



26
27
28
# File 'lib/yardstick/processor.rb', line 26

def process
  Parser.parse_paths(paths).measure(@config)
end

#process_string(string) ⇒ Yardstick::MeasurementSet

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Measure string provided

Parameters:

  • string (#to_str)

    the string to measure

Returns:



39
40
41
# File 'lib/yardstick/processor.rb', line 39

def process_string(string)
  Parser.parse_string(string).measure(@config)
end