Class: Redmine::Diff

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

Overview

A line of diff

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDiff

Returns a new instance of Diff.



31
32
33
34
35
36
37
38
# File 'lib/redmine/diff.rb', line 31

def initialize
  self.nb_line_left = ''
  self.nb_line_right = ''
  self.line_left = ''
  self.line_right = ''
  self.type_diff_right = ''
  self.type_diff_left = ''
end

Instance Attribute Details

#line_leftObject

Returns the value of attribute line_left.



24
25
26
# File 'lib/redmine/diff.rb', line 24

def line_left
  @line_left
end

#line_rightObject

Returns the value of attribute line_right.



26
27
28
# File 'lib/redmine/diff.rb', line 26

def line_right
  @line_right
end

#nb_line_leftObject

Returns the value of attribute nb_line_left.



23
24
25
# File 'lib/redmine/diff.rb', line 23

def nb_line_left
  @nb_line_left
end

#nb_line_rightObject

Returns the value of attribute nb_line_right.



25
26
27
# File 'lib/redmine/diff.rb', line 25

def nb_line_right
  @nb_line_right
end

#offsetsObject

Returns the value of attribute offsets.



29
30
31
# File 'lib/redmine/diff.rb', line 29

def offsets
  @offsets
end

#type_diff_leftObject

Returns the value of attribute type_diff_left.



28
29
30
# File 'lib/redmine/diff.rb', line 28

def type_diff_left
  @type_diff_left
end

#type_diff_rightObject

Returns the value of attribute type_diff_right.



27
28
29
# File 'lib/redmine/diff.rb', line 27

def type_diff_right
  @type_diff_right
end

Instance Method Details

#html_lineObject



56
57
58
# File 'lib/redmine/diff.rb', line 56

def html_line
  line_to_html(line, offsets)
end

#html_line_leftObject



48
49
50
# File 'lib/redmine/diff.rb', line 48

def html_line_left
  line_to_html(line_left, offsets)
end

#html_line_rightObject



52
53
54
# File 'lib/redmine/diff.rb', line 52

def html_line_right
  line_to_html(line_right, offsets)
end

#inspectObject



60
61
62
63
64
65
66
# File 'lib/redmine/diff.rb', line 60

def inspect
  puts '### Start Line Diff ###'
  puts self.nb_line_left
  puts self.line_left
  puts self.nb_line_right
  puts self.line_right
end

#lineObject



44
45
46
# File 'lib/redmine/diff.rb', line 44

def line
  type_diff_right == 'diff_in' ? line_right : line_left
end

#type_diffObject



40
41
42
# File 'lib/redmine/diff.rb', line 40

def type_diff
  type_diff_right == 'diff_in' ? type_diff_right : type_diff_left
end