Class: DeepLDiff::Spacing

Inherits:
Object
  • Object
show all
Defined in:
lib/deepl_diff/spacing.rb

Overview

Adds same count leading-trailing spaces left has to the right

Class Method Summary collapse

Class Method Details

.restore(left, right) ⇒ Object

DeepLDiff::Spacing.restore(“ a ”, “Z”) # => “ Z ”



7
8
9
# File 'lib/deepl_diff/spacing.rb', line 7

def restore(left, right)
  leading(left) + right.strip + trailing(left)
end