Class: Helium::Console::Formatters::Indent
- Inherits:
-
Object
- Object
- Helium::Console::Formatters::Indent
- Defined in:
- lib/helium/console/formatters/indent.rb
Instance Method Summary collapse
- #call(string) ⇒ Object
-
#initialize(indent) ⇒ Indent
constructor
A new instance of Indent.
Constructor Details
#initialize(indent) ⇒ Indent
Returns a new instance of Indent.
7 8 9 |
# File 'lib/helium/console/formatters/indent.rb', line 7 def initialize(indent) @indent = indent end |
Instance Method Details
#call(string) ⇒ Object
11 12 13 |
# File 'lib/helium/console/formatters/indent.rb', line 11 def call(string) string.lines.map { |line| ' ' * @indent + line }.join end |