Class: Bickle::ColorDecorator
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Bickle::ColorDecorator
- Defined in:
- lib/bickle/color_decorator.rb
Instance Method Summary collapse
-
#initialize(build, shell) ⇒ ColorDecorator
constructor
A new instance of ColorDecorator.
- #result ⇒ Object
Constructor Details
#initialize(build, shell) ⇒ ColorDecorator
Returns a new instance of ColorDecorator.
3 4 5 6 7 |
# File 'lib/bickle/color_decorator.rb', line 3 def initialize(build, shell) @build = build @shell = shell super(@build) end |
Instance Method Details
#result ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bickle/color_decorator.rb', line 9 def result res = @build.result if @build.pass? @shell.set_color(res, :green) elsif @build.fail? @shell.set_color(res, :red) else @shell.set_color(res, :yellow) end end |