Class: Tapout::Config
- Inherits:
-
Object
- Object
- Tapout::Config
- Defined in:
- lib/tapout/config.rb
Overview
Configuration.
TODO: Rename the ANSI options with a _color suffix,
or something to that effect.
Instance Attribute Summary collapse
-
#error ⇒ Object
ANSI err.
-
#fail ⇒ Object
ANSI fail.
-
#highlight ⇒ Object
ANSI highlight.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#omit ⇒ Object
ANSI omit.
-
#pass ⇒ Object
ANSI pass.
-
#todo ⇒ Object
ANSI todo.
-
#trace ⇒ Object
Returns the value of attribute trace.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
Initialize new Config instance.
-
#initialize_defaults ⇒ Object
Initialize defaults.
- #minimal=(boolean) ⇒ Object
- #minimal? ⇒ Boolean
-
#trace_depth ⇒ Object
Alias for #trace.
- #update(settings, &block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Initialize new Config instance.
28 29 30 |
# File 'lib/tapout/config.rb', line 28 def initialize initialize_defaults end |
Instance Attribute Details
#error ⇒ Object
ANSI err
114 115 116 |
# File 'lib/tapout/config.rb', line 114 def error @error end |
#fail ⇒ Object
ANSI fail
107 108 109 |
# File 'lib/tapout/config.rb', line 107 def fail @fail end |
#highlight ⇒ Object
ANSI highlight
93 94 95 |
# File 'lib/tapout/config.rb', line 93 def highlight @highlight end |
#lines ⇒ Object
Returns the value of attribute lines.
75 76 77 |
# File 'lib/tapout/config.rb', line 75 def lines @lines end |
#omit ⇒ Object
ANSI omit
128 129 130 |
# File 'lib/tapout/config.rb', line 128 def omit @omit end |
#pass ⇒ Object
ANSI pass
100 101 102 |
# File 'lib/tapout/config.rb', line 100 def pass @pass end |
#todo ⇒ Object
ANSI todo
121 122 123 |
# File 'lib/tapout/config.rb', line 121 def todo @todo end |
#trace ⇒ Object
Returns the value of attribute trace.
62 63 64 |
# File 'lib/tapout/config.rb', line 62 def trace @trace end |
Instance Method Details
#initialize_defaults ⇒ Object
Initialize defaults.
-
Default trace depth is 12.
-
Default snippet size is 3 (which means 7 total).
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/tapout/config.rb', line 37 def initialize_defaults @trace = 12 @lines = 3 @minimal = false @highlight = [:bold] @fadelight = [:dark] @pass = [:green] @fail = [:red] @error = [:red] @todo = [:yellow] @omit = [:yellow] end |
#minimal=(boolean) ⇒ Object
88 89 90 |
# File 'lib/tapout/config.rb', line 88 def minimal=(boolean) @minimal = boolean ? true : false end |
#minimal? ⇒ Boolean
83 84 85 |
# File 'lib/tapout/config.rb', line 83 def minimal? @minimal end |
#trace_depth ⇒ Object
Alias for #trace.
70 71 72 |
# File 'lib/tapout/config.rb', line 70 def trace_depth @trace end |
#update(settings, &block) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/tapout/config.rb', line 53 def update(settings, &block) settings.each do |k,v| __send__("#{k}=", v) end if settings block.call(self) if block self end |