Class: FlexValidations::IndentedString Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(original, level: 2, indentation: ' ') ⇒ IndentedString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of IndentedString.

Parameters:



75
76
77
78
79
# File 'lib/flex_validations.rb', line 75

def initialize(original, level: 2, indentation: ' ')
  @original = original
  @level = level
  @indentation = indentation
end

Instance Method Details

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



81
82
83
84
85
# File 'lib/flex_validations.rb', line 81

def to_s
  @original.to_s.lines.map do |line|
    "#{@indentation * @level}#{line}"
  end.join('')
end