Class: Rubycritic::SmellsIndexGenerator
- Inherits:
-
BaseGenerator
- Object
- BaseGenerator
- Rubycritic::SmellsIndexGenerator
- Defined in:
- lib/rubycritic/report_generators/smells_index_generator.rb
Constant Summary collapse
- TEMPLATE =
erb_template("smells_index.html.erb")
Constants inherited from BaseGenerator
BaseGenerator::LAYOUT_TEMPLATE, BaseGenerator::TEMPLATES_DIR
Instance Method Summary collapse
- #file_name ⇒ Object
-
#initialize(smells) ⇒ SmellsIndexGenerator
constructor
A new instance of SmellsIndexGenerator.
- #render ⇒ Object
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(smells) ⇒ SmellsIndexGenerator
Returns a new instance of SmellsIndexGenerator.
9 10 11 |
# File 'lib/rubycritic/report_generators/smells_index_generator.rb', line 9 def initialize(smells) @smells = smells.sort { |a, b| a.type <=> b.type } end |
Instance Method Details
#file_name ⇒ Object
13 14 15 |
# File 'lib/rubycritic/report_generators/smells_index_generator.rb', line 13 def file_name "smells_index.html" end |
#render ⇒ Object
17 18 19 20 |
# File 'lib/rubycritic/report_generators/smells_index_generator.rb', line 17 def render index_body = TEMPLATE.result(get_binding) LAYOUT_TEMPLATE.result(get_binding { index_body }) end |