Class: FlutterRb::CheckReport
- Inherits:
-
Object
- Object
- FlutterRb::CheckReport
- Defined in:
- lib/flutter_rb/report/check_report.rb
Overview
Check report
Instance Attribute Summary collapse
-
#check_name ⇒ Object
readonly
Returns the value of attribute check_name.
-
#check_report_status ⇒ Object
readonly
Returns the value of attribute check_report_status.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #color_for_report_status(check_report_status) ⇒ Presenter
-
#initialize(check_name, check_report_status, message, path) ⇒ CheckReport
constructor
A new instance of CheckReport.
- #print(colorize: true) ⇒ String
Constructor Details
#initialize(check_name, check_report_status, message, path) ⇒ CheckReport
Returns a new instance of CheckReport.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/flutter_rb/report/check_report.rb', line 10 def initialize( check_name, check_report_status, , path ) @check_name = check_name @check_report_status = check_report_status = @path = path end |
Instance Attribute Details
#check_name ⇒ Object (readonly)
Returns the value of attribute check_name.
48 49 50 |
# File 'lib/flutter_rb/report/check_report.rb', line 48 def check_name @check_name end |
#check_report_status ⇒ Object (readonly)
Returns the value of attribute check_report_status.
48 49 50 |
# File 'lib/flutter_rb/report/check_report.rb', line 48 def check_report_status @check_report_status end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
48 49 50 |
# File 'lib/flutter_rb/report/check_report.rb', line 48 def end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
48 49 50 |
# File 'lib/flutter_rb/report/check_report.rb', line 48 def path @path end |
Instance Method Details
#color_for_report_status(check_report_status) ⇒ Presenter
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/flutter_rb/report/check_report.rb', line 35 def color_for_report_status(check_report_status) case check_report_status when CheckReportStatus::NORMAL :green when CheckReportStatus::WARNING :yellow when CheckReportStatus::ERROR :red else :blue end end |
#print(colorize: true) ⇒ String
24 25 26 27 28 29 30 31 |
# File 'lib/flutter_rb/report/check_report.rb', line 24 def print(colorize: true) if colorize status_color = color_for_report_status(@check_report_status) " * [#{@check_report_status.colorize(status_color)}] #{@check_name}: #{@message}" else " * [#{@check_report_status}] #{@check_name}: #{@message}" end end |