Class: AppRelease::Console
- Inherits:
-
Object
- Object
- AppRelease::Console
- Defined in:
- lib/app_release/console.rb
Class Method Summary collapse
- .danger(text) ⇒ Object
- .log(text) ⇒ Object
- .print(text, color = nil) ⇒ Object
- .success(text) ⇒ Object
- .warning(text) ⇒ Object
Instance Method Summary collapse
-
#initialize(text, color = nil) ⇒ Console
constructor
A new instance of Console.
- #print ⇒ Object
Constructor Details
#initialize(text, color = nil) ⇒ Console
Returns a new instance of Console.
25 26 27 28 |
# File 'lib/app_release/console.rb', line 25 def initialize(text, color = nil) @text = text @color = color end |
Class Method Details
.danger(text) ⇒ Object
21 22 23 |
# File 'lib/app_release/console.rb', line 21 def self.danger(text) new(text, :red).print end |
.log(text) ⇒ Object
9 10 11 |
# File 'lib/app_release/console.rb', line 9 def self.log(text) new(text, nil).print end |
.print(text, color = nil) ⇒ Object
5 6 7 |
# File 'lib/app_release/console.rb', line 5 def self.print(text, color = nil) new(text, color).print end |
.success(text) ⇒ Object
13 14 15 |
# File 'lib/app_release/console.rb', line 13 def self.success(text) new(text, :green).print end |
.warning(text) ⇒ Object
17 18 19 |
# File 'lib/app_release/console.rb', line 17 def self.warning(text) new(text, :yellow).print end |
Instance Method Details
#print ⇒ Object
30 31 32 |
# File 'lib/app_release/console.rb', line 30 def print puts @text.colorize(@color) end |