Module: Indent

Defined in:
lib/vertigo/indent.rb

Constant Summary collapse

INDENT =
2

Instance Method Summary collapse

Instance Method Details

#dedentObject



11
12
13
# File 'lib/vertigo/indent.rb', line 11

def dedent
  @indentation-=INDENT
end

#indent(str) ⇒ Object



5
6
7
8
9
# File 'lib/vertigo/indent.rb', line 5

def indent str
  @indentation||=-INDENT
  @indentation+=INDENT
  say(str)
end

#say(str) ⇒ Object



15
16
17
18
# File 'lib/vertigo/indent.rb', line 15

def say str
  @indentation||=0
  puts " "*@indentation+str if @verbose
end