Class: Diffed::Line
Instance Attribute Summary collapse
-
#left_line_num ⇒ Object
readonly
Returns the value of attribute left_line_num.
-
#no_newline ⇒ Object
Returns the value of attribute no_newline.
-
#right_line_num ⇒ Object
readonly
Returns the value of attribute right_line_num.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #as_html_row(use_inline_styles, highlight = false) ⇒ Object
-
#initialize(type, text, left_line_num, right_line_num) ⇒ Line
constructor
A new instance of Line.
- #left? ⇒ Boolean
- #right? ⇒ Boolean
Methods included from DiffHtml
Constructor Details
#initialize(type, text, left_line_num, right_line_num) ⇒ Line
Returns a new instance of Line.
8 9 10 |
# File 'lib/models/line.rb', line 8 def initialize(type, text, left_line_num, right_line_num) @type, @text, @left_line_num, @right_line_num, @no_newline = type, text, left_line_num, right_line_num, false end |
Instance Attribute Details
#left_line_num ⇒ Object (readonly)
Returns the value of attribute left_line_num.
6 7 8 |
# File 'lib/models/line.rb', line 6 def left_line_num @left_line_num end |
#no_newline ⇒ Object
Returns the value of attribute no_newline.
6 7 8 |
# File 'lib/models/line.rb', line 6 def no_newline @no_newline end |
#right_line_num ⇒ Object (readonly)
Returns the value of attribute right_line_num.
6 7 8 |
# File 'lib/models/line.rb', line 6 def right_line_num @right_line_num end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/models/line.rb', line 6 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/models/line.rb', line 6 def type @type end |
Instance Method Details
#as_html_row(use_inline_styles, highlight = false) ⇒ Object
25 26 27 |
# File 'lib/models/line.rb', line 25 def as_html_row(use_inline_styles, highlight = false) format_code_line(use_inline_styles, highlight) end |
#left? ⇒ Boolean
12 13 14 |
# File 'lib/models/line.rb', line 12 def left? @type == :left || @type == :both end |
#right? ⇒ Boolean
16 17 18 |
# File 'lib/models/line.rb', line 16 def right? @type == :right || @type == :both end |