Module: Riml::Indentable

Included in:
ControlStructure, DefNode, ForNode, TryNode
Defined in:
lib/riml/nodes.rb

Instance Method Summary collapse

Instance Method Details

#indentObject



47
48
49
# File 'lib/riml/nodes.rb', line 47

def indent
  @indent ||= ' ' * 2
end

#indented?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/riml/nodes.rb', line 50

def indented?
  indent.size > 0
end

#outdentObject



53
54
55
56
57
# File 'lib/riml/nodes.rb', line 53

def outdent
  size = indent.size
  return '' unless size > 0
  ' ' * (size - 2)
end