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.
-
#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.
-
#connection_status_data? ⇒ Boolean
True if status data exists; otherwise false.
-
#initialize(authorities_list:, connection_status_data:, accuracy_status_data:) ⇒ CheckStatusPresenter
constructor
A new instance of CheckStatusPresenter.
- #label_all_checks ⇒ Object
- #label_check_accuracy ⇒ Object
- #label_check_connections ⇒ 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_connections ⇒ Object
- #value_check_param ⇒ Object
Constructor Details
#initialize(authorities_list:, connection_status_data:, accuracy_status_data:) ⇒ CheckStatusPresenter
Returns a new instance of CheckStatusPresenter.
7 8 9 10 11 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 7 def initialize(authorities_list:, connection_status_data:, accuracy_status_data:) @authorities_list = @connection_status_data = connection_status_data @accuracy_status_data = accuracy_status_data end |
Instance Attribute Details
#accuracy_status_data ⇒ Array<Hash> (readonly)
rubocop:disable Style/AsciiComments
44 45 46 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 44 def accuracy_status_data @accuracy_status_data end |
#authorities_list ⇒ Array<String> (readonly)
Returns A list of all loaded authorities’ names.
15 16 17 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 15 def @authorities_list end |
#connection_status_data ⇒ Array<Hash> (readonly)
rubocop:disable Style/AsciiComments
28 29 30 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 28 def connection_status_data @connection_status_data end |
Instance Method Details
#accuracy_status_data? ⇒ Boolean
Returns true if status data exists; otherwise false.
53 54 55 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 53 def accuracy_status_data? @accuracy_status_data.present? end |
#connection_status_data? ⇒ Boolean
Returns true if status data exists; otherwise false.
48 49 50 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 48 def connection_status_data? @connection_status_data.present? end |
#label_all_checks ⇒ Object
102 103 104 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 102 def label_all_checks "#{value_check_param}_#{value_all_checks}".downcase.to_sym end |
#label_check_accuracy ⇒ Object
94 95 96 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 94 def label_check_accuracy "#{value_check_param}_#{value_check_accuracy}".downcase.to_sym end |
#label_check_connections ⇒ Object
86 87 88 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 86 def label_check_connections "#{value_check_param}_#{value_check_connections}".downcase.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.
63 64 65 66 67 68 69 70 71 72 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 63 def status_label(status) case status[: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.
58 59 60 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 58 def status_style_class(status) "status-#{status[:status]}" end |
#value_all_checks ⇒ Object
98 99 100 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 98 def value_all_checks QaServer::AuthorityValidationController::ALL_VALIDATIONS end |
#value_all_collections ⇒ Object
74 75 76 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 74 def value_all_collections QaServer::CheckStatusController::ALL_AUTHORITIES end |
#value_check_accuracy ⇒ Object
90 91 92 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 90 def value_check_accuracy QaServer::AuthorityValidationController::VALIDATE_ACCURACY end |
#value_check_connections ⇒ Object
82 83 84 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 82 def value_check_connections QaServer::AuthorityValidationController::VALIDATE_CONNECTIONS end |
#value_check_param ⇒ Object
78 79 80 |
# File 'app/presenters/qa_server/check_status_presenter.rb', line 78 def value_check_param QaServer::AuthorityValidationController::VALIDATION_TYPE_PARAM end |