Module: Alienor::Indentation
- Included in:
- CoreObject
- Defined in:
- lib/alienor/indentation.rb
Instance Method Summary collapse
Instance Method Details
#add_line(r, s = "") ⇒ Object
20 21 22 |
# File 'lib/alienor/indentation.rb', line 20 def add_line(r, s = "") r.replace(r + ("\t" * @source.nb_indent) + s + "\n") end |
#indent ⇒ Object
12 13 14 |
# File 'lib/alienor/indentation.rb', line 12 def indent @source.nb_indent += 1 end |
#init_indent ⇒ Object
8 9 10 |
# File 'lib/alienor/indentation.rb', line 8 def init_indent @source.nb_indent = 0 end |
#unindent ⇒ Object
16 17 18 |
# File 'lib/alienor/indentation.rb', line 16 def unindent @source.nb_indent -= 1 end |