class RubyCritic::Generator::Html::Line

Constants

NORMAL_TEMPLATE
SMELLY_TEMPLATE

Attributes

file_directory[R]

Public Class Methods

new(file_directory, text, smells) click to toggle source
# 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

Public Instance Methods

render() click to toggle source
# File lib/rubycritic/generators/html/line.rb, line 21
def render
  template.result(binding).delete("\n") + "\n"
end

Private Instance Methods

template() click to toggle source
# File lib/rubycritic/generators/html/line.rb, line 27
def template
  if @smells.empty?
    NORMAL_TEMPLATE
  else
    SMELLY_TEMPLATE
  end
end