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:



14
15
16
# File 'lib/yardstick/processor.rb', line 14

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:



24
25
26
# File 'lib/yardstick/processor.rb', line 24

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:



37
38
39
# File 'lib/yardstick/processor.rb', line 37

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