Class: SimpleCov::SourceFile::LineBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov/source_file/line_builder.rb

Overview

Builds the ‘SourceFile::Line` objects for a source file from the raw line-coverage array. Each line carries its source text, its 1-based line number, and the Coverage hit count (or nil for never-counted lines). Applies `# simplecov:disable` / `# :nocov:` block ranges via `skipped!`.

Instance Method Summary collapse

Constructor Details

#initialize(source_file) ⇒ LineBuilder

Returns a new instance of LineBuilder.



11
12
13
# File 'lib/simplecov/source_file/line_builder.rb', line 11

def initialize(source_file)
  @source_file = source_file
end

Instance Method Details

#callObject



15
16
17
18
19
# File 'lib/simplecov/source_file/line_builder.rb', line 15

def call
  lines = build_lines
  mark_skipped(lines, @source_file.skip_chunks_for(:line))
  lines
end