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', __FILE__)
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.


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

def initialize(analysed_module)
  @analysed_module = analysed_module
end

Class Method Details

.erb_templateObject


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

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

Instance Method Details

#renderObject


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

def render
  erb_template.result(binding)
end