Class: Diffing::Part
- Inherits:
-
Object
- Object
- Diffing::Part
- Defined in:
- lib/diffing/part.rb
Instance Attribute Summary collapse
-
#delete ⇒ Object
readonly
Returns the value of attribute delete.
-
#insert ⇒ Object
readonly
Returns the value of attribute insert.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #delete? ⇒ Boolean
-
#initialize(source: '', insert: '', delete: '') ⇒ Part
constructor
A new instance of Part.
- #insert? ⇒ Boolean
- #replace? ⇒ Boolean
- #source? ⇒ Boolean
Constructor Details
#initialize(source: '', insert: '', delete: '') ⇒ Part
Returns a new instance of Part.
8 9 10 |
# File 'lib/diffing/part.rb', line 8 def initialize( source: '', insert: '', delete: '' ) @source, @insert, @delete = source, insert, delete end |
Instance Attribute Details
#delete ⇒ Object (readonly)
Returns the value of attribute delete.
6 7 8 |
# File 'lib/diffing/part.rb', line 6 def delete @delete end |
#insert ⇒ Object (readonly)
Returns the value of attribute insert.
6 7 8 |
# File 'lib/diffing/part.rb', line 6 def insert @insert end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/diffing/part.rb', line 6 def source @source end |
Instance Method Details
#delete? ⇒ Boolean
20 21 22 |
# File 'lib/diffing/part.rb', line 20 def delete? not @delete.empty? end |
#insert? ⇒ Boolean
16 17 18 |
# File 'lib/diffing/part.rb', line 16 def insert? not @insert.empty? end |
#replace? ⇒ Boolean
24 25 26 |
# File 'lib/diffing/part.rb', line 24 def replace? not @insert.empty? and not @delete.empty? end |
#source? ⇒ Boolean
12 13 14 |
# File 'lib/diffing/part.rb', line 12 def source? not @source.empty? end |