Class: RubyCritic::Generator::Text::List
- Inherits:
-
Object
- Object
- RubyCritic::Generator::Text::List
- Defined in:
- lib/rubycritic/generators/text/list.rb
Constant Summary collapse
- TEMPLATE_PATH =
File.('../templates/list.erb', __FILE__)
- RATING_TO_COLOR =
{ 'A' => :green, 'B' => :green, 'C' => :yellow, 'D' => :light_red, 'F' => :red }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(analysed_module) ⇒ List
constructor
A new instance of List.
- #render ⇒ Object
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_template ⇒ Object
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
#render ⇒ Object
28 29 30 |
# File 'lib/rubycritic/generators/text/list.rb', line 28 def render erb_template.result(binding) end |