Class: Diffed::Html::OutputRow

Inherits:
Object
  • Object
show all
Defined in:
lib/formatters/html.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ OutputRow

Returns a new instance of OutputRow.



38
39
40
41
42
43
44
45
# File 'lib/formatters/html.rb', line 38

def initialize(params = {})
  if params[:code_line].nil?
    @left, @right, @text = params[:left], params[:right], params[:text]
  else
    line = params[:code_line]
    @left, @right, @text = line.left_line_num, line.right_line_num, line.text
  end
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



36
37
38
# File 'lib/formatters/html.rb', line 36

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



36
37
38
# File 'lib/formatters/html.rb', line 36

def right
  @right
end

Instance Method Details

#textObject



47
48
49
# File 'lib/formatters/html.rb', line 47

def text
  EscapeUtils.escape_html(@text, false)
end