Class: Rubycritic::OverviewGenerator

Inherits:
BaseGenerator show all
Defined in:
lib/rubycritic/report_generators/overview_generator.rb

Constant Summary collapse

TEMPLATE =
erb_template("overview.html.erb")

Constants inherited from BaseGenerator

BaseGenerator::LAYOUT_TEMPLATE, BaseGenerator::TEMPLATES_DIR

Instance Method Summary collapse

Methods inherited from BaseGenerator

erb_template, #file_directory, #file_href, #file_pathname, #get_binding

Methods included from ViewHelpers

#analysed_file_name, #asset_path, #code_index_path, #javascript_path, #overview_path, #root_directory, #smell_location_path, #smells_index_path, #stylesheet_path

Constructor Details

#initialize(turbulence_data) ⇒ OverviewGenerator

Returns a new instance of OverviewGenerator.



10
11
12
# File 'lib/rubycritic/report_generators/overview_generator.rb', line 10

def initialize(turbulence_data)
  @turbulence_data = turbulence_data.to_json
end

Instance Method Details

#file_nameObject



14
15
16
# File 'lib/rubycritic/report_generators/overview_generator.rb', line 14

def file_name
  "overview.html"
end

#renderObject



18
19
20
21
# File 'lib/rubycritic/report_generators/overview_generator.rb', line 18

def render
  index_body = TEMPLATE.result(get_binding)
  LAYOUT_TEMPLATE.result(get_binding { index_body })
end