Class: QaServer::CheckStatusPresenter
- Inherits:
-
Object
- Object
- QaServer::CheckStatusPresenter
- Defined in:
- app/presenters/qa_server/check_status_presenter.rb
Instance Attribute Summary collapse
-
#accuracy_status_data ⇒ Array<Hash>
readonly
rubocop:disable Style/AsciiComments.
-
#authorities_list ⇒ Array<String>
readonly
A list of all loaded authorities’ names.
-
#comparison_status_data ⇒ Array<Hash>
readonly
rubocop:disable Style/AsciiComments.
-
#connection_status_data ⇒ Array<Hash>
readonly
rubocop:disable Style/AsciiComments.
Instance Method Summary collapse
-
#accuracy_status_data? ⇒ Boolean
True if status data exists; otherwise false.
- #accuracy_tests_checked ⇒ Object
-
#comparison_status_data? ⇒ Boolean
True if status data exists; otherwise false.
- #comparison_tests_checked ⇒ Object
-
#connection_status_data? ⇒ Boolean
True if status data exists; otherwise false.
- #connection_tests_checked ⇒ Object
-
#initialize(authorities_list:, connection_status_data:, accuracy_status_data:, comparison_status_data:) ⇒ CheckStatusPresenter
constructor
A new instance of CheckStatusPresenter.
- #label_all_checks ⇒ Object
- #label_check_accuracy ⇒ Object
- #label_check_comparison ⇒ Object
- #label_check_connections ⇒ Object
- #selected_authority ⇒ Object
- #selected_comparison ⇒ Object
-
#status_label(status) ⇒ String
The name of the css style class to use for the status cell based on the status of the scenario test.
-
#status_style_class(status) ⇒ String
The name of the css style class to use for the status cell based on the status of the scenario test.
- #value_all_checks ⇒ Object
- #value_all_collections ⇒ Object
- #value_check_accuracy ⇒ Object
- #value_check_comparison ⇒ Object
- #value_check_connections ⇒ Object
- #value_check_param ⇒ Object
Constructor Details
#initialize(authorities_list:, connection_status_data:, accuracy_status_data:, comparison_status_data:) ⇒ CheckStatusPresenter
Returns a new instance of CheckStatusPresenter.
7 8 9 10 11 12 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 7 def initialize(authorities_list:, connection_status_data:, accuracy_status_data:, comparison_status_data:) = @connection_status_data = connection_status_data @accuracy_status_data = accuracy_status_data @comparison_status_data = comparison_status_data end |
Instance Attribute Details
#accuracy_status_data ⇒ Array<Hash> (readonly)
rubocop:disable Style/AsciiComments
45 46 47 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 45 def accuracy_status_data @accuracy_status_data end |
#authorities_list ⇒ Array<String> (readonly)
Returns A list of all loaded authorities’ names.
16 17 18 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 16 def end |
#comparison_status_data ⇒ Array<Hash> (readonly)
rubocop:disable Style/AsciiComments
64 65 66 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 64 def comparison_status_data @comparison_status_data end |
#connection_status_data ⇒ Array<Hash> (readonly)
rubocop:disable Style/AsciiComments
29 30 31 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 29 def connection_status_data @connection_status_data end |
Instance Method Details
#accuracy_status_data? ⇒ Boolean
Returns true if status data exists; otherwise false.
73 74 75 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 73 def accuracy_status_data? @accuracy_status_data.present? end |
#accuracy_tests_checked ⇒ Object
138 139 140 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 138 def accuracy_tests_checked accuracy_status_data? end |
#comparison_status_data? ⇒ Boolean
Returns true if status data exists; otherwise false.
78 79 80 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 78 def comparison_status_data? @comparison_status_data.present? end |
#comparison_tests_checked ⇒ Object
150 151 152 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 150 def comparison_tests_checked comparison_status_data? end |
#connection_status_data? ⇒ Boolean
Returns true if status data exists; otherwise false.
68 69 70 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 68 def connection_status_data? @connection_status_data.present? end |
#connection_tests_checked ⇒ Object
126 127 128 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 126 def connection_tests_checked connection_status_data? end |
#label_all_checks ⇒ Object
158 159 160 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 158 def label_all_checks "#{value_check_param}_#{value_all_checks}".downcase.to_sym end |
#label_check_accuracy ⇒ Object
134 135 136 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 134 def label_check_accuracy "#{value_check_param}_#{value_check_accuracy}".downcase.to_sym end |
#label_check_comparison ⇒ Object
146 147 148 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 146 def label_check_comparison "#{value_check_param}_#{value_check_comparison}".downcase.to_sym end |
#label_check_connections ⇒ Object
122 123 124 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 122 def label_check_connections "#{value_check_param}_#{value_check_connections}".downcase.to_sym end |
#selected_authority ⇒ Object
99 100 101 102 103 104 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 99 def return comparison_status_data.first[:authority_name][0].to_sym if comparison_status_data? return connection_status_data.first[:authority_name].to_sym if connection_status_data? return accuracy_status_data.first[:authority_name].to_sym if accuracy_status_data? "" end |
#selected_comparison ⇒ Object
106 107 108 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 106 def selected_comparison comparison_status_data? ? comparison_status_data.first[:authority_name][1].to_sym : "" end |
#status_label(status) ⇒ String
Returns the name of the css style class to use for the status cell based on the status of the scenario test.
88 89 90 91 92 93 94 95 96 97 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 88 def status_label(status) case status when :good QaServer::ScenarioRunHistory::GOOD_MARKER when :bad QaServer::ScenarioRunHistory::BAD_MARKER when :unknown QaServer::ScenarioRunHistory::UNKNOWN_MARKER end end |
#status_style_class(status) ⇒ String
Returns the name of the css style class to use for the status cell based on the status of the scenario test.
83 84 85 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 83 def status_style_class(status) status[:pending] ? "status-dogear status-#{status[:status]}" : "status-#{status[:status]}" end |
#value_all_checks ⇒ Object
154 155 156 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 154 def value_all_checks QaServer::AuthorityValidationBehavior::ALL_VALIDATIONS end |
#value_all_collections ⇒ Object
110 111 112 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 110 def value_all_collections QaServer::CheckStatusController::ALL_AUTHORITIES end |
#value_check_accuracy ⇒ Object
130 131 132 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 130 def value_check_accuracy QaServer::AuthorityValidationBehavior::VALIDATE_ACCURACY end |
#value_check_comparison ⇒ Object
142 143 144 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 142 def value_check_comparison QaServer::AuthorityValidationBehavior::VALIDATE_ACCURACY_COMPARISON end |
#value_check_connections ⇒ Object
118 119 120 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 118 def value_check_connections QaServer::AuthorityValidationBehavior::VALIDATE_CONNECTIONS end |
#value_check_param ⇒ Object
114 115 116 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 114 def value_check_param QaServer::AuthorityValidationBehavior::VALIDATION_TYPE_PARAM end |