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.
23 24 25 |
# File 'lib/rubycritic/generators/text/list.rb', line 23 def initialize(analysed_module) @analysed_module = analysed_module end |
Class Method Details
.erb_template ⇒ Object
10 11 12 |
# File 'lib/rubycritic/generators/text/list.rb', line 10 def erb_template @erb_template ||= ERB.new(File.read(TEMPLATE_PATH), nil, '-') end |
Instance Method Details
#render ⇒ Object
27 28 29 |
# File 'lib/rubycritic/generators/text/list.rb', line 27 def render erb_template.result(binding) end |