Class: Diffed::Diff::OutputRow

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ OutputRow

Returns a new instance of OutputRow.



92
93
94
95
96
97
98
99
# File 'lib/diffed.rb', line 92

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.



90
91
92
# File 'lib/diffed.rb', line 90

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



90
91
92
# File 'lib/diffed.rb', line 90

def right
  @right
end

Instance Method Details

#textObject



101
102
103
# File 'lib/diffed.rb', line 101

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