Class: RunKit::Options::Color
- Inherits:
-
Object
- Object
- RunKit::Options::Color
- Defined in:
- lib/run_kit/options/color.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
(also: #enabled?)
readonly
Returns the value of attribute enabled.
Instance Method Summary collapse
-
#blue(str) ⇒ Object
one-liners.
- #cyan(str) ⇒ Object
- #green(str) ⇒ Object
-
#initialize(enabled) ⇒ Color
constructor
A new instance of Color.
- #magenta(str) ⇒ Object
- #red(str) ⇒ Object
- #yellow(str) ⇒ Object
Constructor Details
#initialize(enabled) ⇒ Color
Returns a new instance of Color.
11 12 13 |
# File 'lib/run_kit/options/color.rb', line 11 def initialize(enabled) @enabled = enabled.nil? ? $stdout.tty? : enabled end |
Instance Attribute Details
#enabled ⇒ Object (readonly) Also known as: enabled?
Returns the value of attribute enabled.
8 9 10 |
# File 'lib/run_kit/options/color.rb', line 8 def enabled @enabled end |
Instance Method Details
#blue(str) ⇒ Object
one-liners
16 |
# File 'lib/run_kit/options/color.rb', line 16 def blue(str) = paint8(str, :blue) |
#cyan(str) ⇒ Object
17 |
# File 'lib/run_kit/options/color.rb', line 17 def cyan(str) = paint8(str, :cyan) |
#green(str) ⇒ Object
18 |
# File 'lib/run_kit/options/color.rb', line 18 def green(str) = paint8(str, :green) |
#magenta(str) ⇒ Object
19 |
# File 'lib/run_kit/options/color.rb', line 19 def magenta(str) = paint8(str, :magenta) |
#red(str) ⇒ Object
20 |
# File 'lib/run_kit/options/color.rb', line 20 def red(str) = paint8(str, :red) |
#yellow(str) ⇒ Object
21 |
# File 'lib/run_kit/options/color.rb', line 21 def yellow(str) = paint8(str, :yellow) |