Class: Helium::Console::Formatters::Indent

Inherits:
Object
  • Object
show all
Defined in:
lib/helium/console/formatters/indent.rb

Instance Method Summary collapse

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