Class: RubyCritic::Generator::Html::Line
- Defined in:
- lib/rubycritic/generators/html/line.rb
Constant Summary collapse
- NORMAL_TEMPLATE =
erb_template('line.html.erb')
- SMELLY_TEMPLATE =
erb_template('smelly_line.html.erb')
Constants inherited from Base
Base::LAYOUT_TEMPLATE, Base::TEMPLATES_DIR
Instance Attribute Summary collapse
-
#file_directory ⇒ Object
readonly
Returns the value of attribute file_directory.
Instance Method Summary collapse
-
#initialize(file_directory, text, smells) ⇒ Line
constructor
A new instance of Line.
- #render ⇒ Object
Methods inherited from Base
erb_template, #file_href, #file_name, #file_pathname
Methods included from ViewHelpers
#asset_path, #code_index_path, #file_path, #smell_location_path, #timeago_tag
Constructor Details
#initialize(file_directory, text, smells) ⇒ Line
Returns a new instance of Line.
15 16 17 18 19 |
# File 'lib/rubycritic/generators/html/line.rb', line 15 def initialize(file_directory, text, smells) @file_directory = file_directory @text = CGI.escapeHTML(text.chomp) @smells = smells end |
Instance Attribute Details
#file_directory ⇒ Object (readonly)
Returns the value of attribute file_directory.
13 14 15 |
# File 'lib/rubycritic/generators/html/line.rb', line 13 def file_directory @file_directory end |
Instance Method Details
#render ⇒ Object
21 22 23 |
# File 'lib/rubycritic/generators/html/line.rb', line 21 def render "#{template.result(binding).delete("\n")}\n" end |