Class: SimpleCov::SourceFile::MethodBuilder

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

Overview

# simplecov:disable / # :nocov: chunks as skipped.

Instance Method Summary collapse

Constructor Details

#initialize(source_file) ⇒ MethodBuilder

Returns a new instance of MethodBuilder.



7
8
9
# File 'lib/simplecov/source_file/method_builder.rb', line 7

def initialize(source_file)
  @source_file = source_file
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/simplecov/source_file/method_builder.rb', line 11

def call
  none = {} #: Hash[untyped, Integer]
  raw_methods = @source_file.coverage_data.fetch("methods", none)
  methods = raw_methods.filter_map do |info, hit_count|
    info = RubyDataParser.call(info)
    next if eval_generated_to_ignore?(info)

    Method.new(@source_file, info, hit_count)
  end

  process_skipped(methods)
end