Class: Diffed::Line
- Inherits:
-
Object
- Object
- Diffed::Line
- Defined in:
- lib/models/line.rb
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
-
#initialize(type, text, left_line_num, right_line_num) ⇒ Line
constructor
A new instance of Line.
- #left? ⇒ Boolean
- #right? ⇒ Boolean
Constructor Details
#initialize(type, text, left_line_num, right_line_num) ⇒ Line
Returns a new instance of Line.
5 6 7 |
# File 'lib/models/line.rb', line 5 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.
3 4 5 |
# File 'lib/models/line.rb', line 3 def left_line_num @left_line_num end |
#no_newline ⇒ Object
Returns the value of attribute no_newline.
3 4 5 |
# File 'lib/models/line.rb', line 3 def no_newline @no_newline end |
#right_line_num ⇒ Object (readonly)
Returns the value of attribute right_line_num.
3 4 5 |
# File 'lib/models/line.rb', line 3 def right_line_num @right_line_num end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/models/line.rb', line 3 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/models/line.rb', line 3 def type @type end |
Instance Method Details
#left? ⇒ Boolean
9 10 11 |
# File 'lib/models/line.rb', line 9 def left? @type == :left || @type == :both end |
#right? ⇒ Boolean
13 14 15 |
# File 'lib/models/line.rb', line 13 def right? @type == :right || @type == :both end |