Class: SuperDiff::Core::TieredLinesFormatter::FormattableLine
- Inherits:
-
Object
- Object
- SuperDiff::Core::TieredLinesFormatter::FormattableLine
- Defined in:
- lib/super_diff/core/tiered_lines_formatter.rb
Constant Summary collapse
- INDENTATION_UNIT =
' '
- ICONS =
{ delete: '-', insert: '+', elision: ' ', noop: ' ' }.freeze
- COLORS =
{ delete: :expected, insert: :actual, elision: :elision_marker, noop: :plain }.freeze
Instance Method Summary collapse
Instance Method Details
#color ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/super_diff/core/tiered_lines_formatter.rb', line 49 def color COLORS.fetch(line.type) do raise( KeyError, "Couldn't find color for line type #{line.type.inspect}!" ) end end |
#content ⇒ Object
45 46 47 |
# File 'lib/super_diff/core/tiered_lines_formatter.rb', line 45 def content "#{icon} #{indentation}#{line.prefix}#{line.value}#{possible_comma}" end |