Class: S3Deployer::Color
- Inherits:
-
Object
- Object
- S3Deployer::Color
- Defined in:
- lib/s3_deployer/color.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(color) ⇒ Color
constructor
A new instance of Color.
- #wrap(text) ⇒ Object
Constructor Details
#initialize(color) ⇒ Color
Returns a new instance of Color.
17 18 19 |
# File 'lib/s3_deployer/color.rb', line 17 def initialize(color) @color = color end |
Class Method Details
.green(text) ⇒ Object
4 5 6 |
# File 'lib/s3_deployer/color.rb', line 4 def green(text) self.new(32).wrap(text) end |
.red(text) ⇒ Object
12 13 14 |
# File 'lib/s3_deployer/color.rb', line 12 def red(text) self.new(31).wrap(text) end |
.yellow(text) ⇒ Object
8 9 10 |
# File 'lib/s3_deployer/color.rb', line 8 def yellow(text) self.new(33).wrap(text) end |
Instance Method Details
#wrap(text) ⇒ Object
21 22 23 |
# File 'lib/s3_deployer/color.rb', line 21 def wrap(text) "\e[#{@color}m#{text}\e[0m" end |