Class: Synx::Tabber

Inherits:
Object
  • Object
show all
Defined in:
lib/synx/tabber.rb

Class Method Summary collapse

Class Method Details

.a_single_tabObject



39
40
41
# File 'lib/synx/tabber.rb', line 39

def a_single_tab
  return "  "
end

.currentObject



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

.optionsObject



30
31
32
# File 'lib/synx/tabber.rb', line 30

def options
  @options
end

.options=(options = {}) ⇒ Object



26
27
28
# File 'lib/synx/tabber.rb', line 26

def options=(options = {})
  @options = options
end

.outputObject



44
45
46
# File 'lib/synx/tabber.rb', line 44

def output
  options.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 options[:no_color]
  output.puts (a_single_tab * @tabbing) + str.to_s unless options[:quiet]
end

.resetObject



21
22
23
24
# File 'lib/synx/tabber.rb', line 21

def reset
  @tabbing = 0
  self.options = {}
end