Class: Diff::Edit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#a_lineObject

Returns the value of attribute a_line

Returns:

  • (Object)

    the current value of a_line



14
15
16
# File 'lib/diff.rb', line 14

def a_line
  @a_line
end

#b_lineObject

Returns the value of attribute b_line

Returns:

  • (Object)

    the current value of b_line



14
15
16
# File 'lib/diff.rb', line 14

def b_line
  @b_line
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



14
15
16
# File 'lib/diff.rb', line 14

def type
  @type
end

Instance Method Details

#a_linesObject



15
16
17
# File 'lib/diff.rb', line 15

def a_lines
  [a_line]
end

#to_sObject



19
20
21
22
# File 'lib/diff.rb', line 19

def to_s
  line = a_line || b_line
  SYMBOLS.fetch(type) + line.text
end