Class: Synx::Tabber
- Inherits:
-
Object
- Object
- Synx::Tabber
- Defined in:
- lib/synx/tabber.rb
Class Method Summary collapse
- .a_single_tab ⇒ Object
- .current ⇒ Object
- .decrease(n = 1) ⇒ Object
- .increase(n = 1) ⇒ Object
- .options ⇒ Object
- .options=(options = {}) ⇒ Object
- .output ⇒ Object
- .puts(str = "") ⇒ Object
- .reset ⇒ Object
Class Method Details
.a_single_tab ⇒ Object
39 40 41 |
# File 'lib/synx/tabber.rb', line 39 def a_single_tab return " " end |
.current ⇒ Object
17 18 19 |
# File 'lib/synx/tabber.rb', line 17 def current @tabbing end |
.decrease(n = 1) ⇒ Object
12 13 14 15 |
# File 'lib/synx/tabber.rb', line 12 def decrease(n=1) @tabbing -= n @tabbing = 0 if @tabbing < 0 end |
.increase(n = 1) ⇒ Object
8 9 10 |
# File 'lib/synx/tabber.rb', line 8 def increase(n=1) @tabbing += n end |
.options ⇒ Object
30 31 32 |
# File 'lib/synx/tabber.rb', line 30 def @options end |
.options=(options = {}) ⇒ Object
26 27 28 |
# File 'lib/synx/tabber.rb', line 26 def ( = {}) @options = end |
.output ⇒ Object
44 45 46 |
# File 'lib/synx/tabber.rb', line 44 def output .fetch(:output, $stdout) end |
.puts(str = "") ⇒ Object
34 35 36 37 |
# File 'lib/synx/tabber.rb', line 34 def puts(str="") str = str.uncolorize if [:no_color] output.puts (a_single_tab * @tabbing) + str.to_s unless [:quiet] end |
.reset ⇒ Object
21 22 23 24 |
# File 'lib/synx/tabber.rb', line 21 def reset @tabbing = 0 self. = {} end |