Class: Tapout::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/tapout/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



15
16
17
# File 'lib/tapout/config.rb', line 15

def initialize
  initialize_defaults
end

Instance Attribute Details

#errorObject

ANSI err



92
93
94
# File 'lib/tapout/config.rb', line 92

def error
  @error
end

#failObject

ANSI fail



85
86
87
# File 'lib/tapout/config.rb', line 85

def fail
  @fail
end

#highlightObject

ANSI highlight



71
72
73
# File 'lib/tapout/config.rb', line 71

def highlight
  @highlight
end

#linesObject

Returns the value of attribute lines.



53
54
55
# File 'lib/tapout/config.rb', line 53

def lines
  @lines
end

#omitObject

ANSI omit



106
107
108
# File 'lib/tapout/config.rb', line 106

def omit
  @omit
end

#passObject

ANSI pass



78
79
80
# File 'lib/tapout/config.rb', line 78

def pass
  @pass
end

#todoObject

ANSI todo



99
100
101
# File 'lib/tapout/config.rb', line 99

def todo
  @todo
end

#traceObject

Returns the value of attribute trace.



45
46
47
# File 'lib/tapout/config.rb', line 45

def trace
  @trace
end

Instance Method Details

#initialize_defaultsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/tapout/config.rb', line 20

def initialize_defaults
  @trace     = nil
  @lines     = 3
  @minimal   = false

  @highlight = [:bold]
  @fadelight = [:dark]

  @pass  = [:green]
  @fail  = [:red]
  @error = [:red]
  @todo  = [:yellow]
  @omit  = [:yellow]
end

#minimal=(boolean) ⇒ Object



66
67
68
# File 'lib/tapout/config.rb', line 66

def minimal=(boolean)
  @minimal = boolean ? true : false
end

#minimal?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/tapout/config.rb', line 61

def minimal?
  @minimal
end

#update(settings, &block) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/tapout/config.rb', line 36

def update(settings, &block)
  settings.each do |k,v|
    __send__("#{k}=", v)
  end if settings
  block.call(self) if block
  self
end