class RocketFuel::Precheck::CommandLineResultPresenter
Constants
- FAILURE_ICON
- SUCCESS_ICON
Public Class Methods
new(result)
click to toggle source
# File lib/rocket_fuel/precheck/command_line_result_presenter.rb, line 11 def initialize(result) @result = result end
Public Instance Methods
present()
click to toggle source
# File lib/rocket_fuel/precheck/command_line_result_presenter.rb, line 15 def present print_wrapped(set_color([icon.render, @result.message].join(" "), color), :indent => 2) end
Protected Instance Methods
color()
click to toggle source
# File lib/rocket_fuel/precheck/command_line_result_presenter.rb, line 33 def color @result.ok? ? :green : :red end
failure_icon()
click to toggle source
# File lib/rocket_fuel/precheck/command_line_result_presenter.rb, line 29 def failure_icon @failure_icon ||= RocketFuel::CommandLineIcon.new(*FAILURE_ICON) end
icon()
click to toggle source
# File lib/rocket_fuel/precheck/command_line_result_presenter.rb, line 21 def icon @result.ok? ? success_icon : failure_icon end
success_icon()
click to toggle source
# File lib/rocket_fuel/precheck/command_line_result_presenter.rb, line 25 def success_icon @success_icon ||= RocketFuel::CommandLineIcon.new(*SUCCESS_ICON) end