Class: CC::Engine::ReportAdapter

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/cc/engine/report_adapter.rb

Overview

Converts the +HamlLint+ report format to CodeClimate issues

Instance Method Summary collapse

Constructor Details

#initialize(report:, root:) ⇒ ReportAdapter

Instantiates a new report adapter

Examples:

CC::Engine::ReportAdapter.new(
  report: HamlLint::Report.new([], %w(a.haml)),
  root: "/tmp"
)

Parameters:

  • report (HamlLint::Report)

    the report to adapt to CodeClimate

  • root (String)

    the root path for the report


27
28
29
30
# File 'lib/cc/engine/report_adapter.rb', line 27

def initialize(report:, root:)
  @report = report
  @root = root
end

Instance Method Details

#eachEnumerator

Enumerates through the issues in a report

Examples:

adapter = CC::Engine::ReportAdapter.new(
  report: HamlLint::Report.new([], %w(a.haml)),
  root: "/tmp"
)

adapter.each { |issue| puts issue }

Returns:

  • (Enumerator)

    an enumerator of the issues in the report

See Also:

  • Array#each

46
# File 'lib/cc/engine/report_adapter.rb', line 46

def_delegators :issues, :each