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', __dir__)
- RATING_TO_COLOR =
{ 'A' => :green, 'B' => :green, 'C' => :yellow, 'D' => :orange, '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.
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_template ⇒ Object
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
#render ⇒ Object
29 30 31 |
# File 'lib/rubycritic/generators/text/list.rb', line 29 def render erb_template.result(binding) end |