Class: RubyCritic::Generator::Text::List

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/generators/text/list.rb

Constant Summary collapse

TEMPLATE_PATH =
File.expand_path('templates/list.erb', __dir__)
RATING_TO_COLOR =
{
  'A' => :green,
  'B' => :green,
  'C' => :yellow,
  'D' => :orange,
  'F' => :red
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(analysed_module) ⇒ List

Returns a new instance of List.



25
26
27
# File 'lib/rubycritic/generators/text/list.rb', line 25

def initialize(analysed_module)
  @analysed_module = analysed_module
end

Class Method Details

.erb_templateObject



12
13
14
# File 'lib/rubycritic/generators/text/list.rb', line 12

def erb_template
  @erb_template ||= ERB.new(File.read(TEMPLATE_PATH), nil, '-')
end

Instance Method Details

#renderObject



29
30
31
# File 'lib/rubycritic/generators/text/list.rb', line 29

def render
  erb_template.result(binding)
end