Module: Indent

Constant Summary collapse

INDENT =
2

Instance Method Summary collapse

Instance Method Details

#dedentObject



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

def dedent
  @indentation-=INDENT
end

#indent(str) ⇒ Object



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

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

#say(str) ⇒ Object



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

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