Class: QaServer::AuthorityScenario
- Inherits:
-
Object
- Object
- QaServer::AuthorityScenario
- Defined in:
- app/models/qa_server/authority_scenario.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_SUBAUTH =
nil
- MIN_EXPECTED_SIZE =
200
Instance Attribute Summary collapse
-
#authority ⇒ Qa::Authorities::LinkedData::GenericAuthority
readonly
Authority instance the scenarios run against.
-
#authority_name ⇒ Symbol
readonly
Name of the authority the scenarios run against (e.g. :AGROVOC_DIRECT).
-
#min_result_size ⇒ Integer
readonly
The minimum size of data that must be returned for the scenario to be considered passing.
-
#service ⇒ String
readonly
Identifies the primary service provider (e.g. ‘ld4l_cache’, ‘direct’, etc.).
-
#subauthority_name ⇒ String
readonly
Name of the subauthority the scenario runs against (e.g. ‘person’).
Instance Method Summary collapse
- #context? ⇒ Boolean
-
#initialize(authority:, authority_name:, authority_scenario_config:, scenario_config: nil) ⇒ AuthorityScenario
constructor
A new instance of AuthorityScenario.
Constructor Details
#initialize(authority:, authority_name:, authority_scenario_config:, scenario_config: nil) ⇒ AuthorityScenario
Returns a new instance of AuthorityScenario.
27 28 29 30 31 32 33 34 |
# File 'app/models/qa_server/authority_scenario.rb', line 27 def initialize(authority:, authority_name:, authority_scenario_config:, scenario_config: nil) @authority = @authority_name = @service = ['service'] @context = scenario_config.key?("position") ? false : .fetch('context', false) @subauthority_name = DEFAULT_SUBAUTH @min_result_size = MIN_EXPECTED_SIZE end |
Instance Attribute Details
#authority ⇒ Qa::Authorities::LinkedData::GenericAuthority (readonly)
Returns authority instance the scenarios run against.
6 7 8 |
# File 'app/models/qa_server/authority_scenario.rb', line 6 def @authority end |
#authority_name ⇒ Symbol (readonly)
Returns name of the authority the scenarios run against (e.g. :AGROVOC_DIRECT).
9 10 11 |
# File 'app/models/qa_server/authority_scenario.rb', line 9 def @authority_name end |
#min_result_size ⇒ Integer (readonly)
Returns the minimum size of data that must be returned for the scenario to be considered passing.
18 19 20 |
# File 'app/models/qa_server/authority_scenario.rb', line 18 def min_result_size @min_result_size end |
#service ⇒ String (readonly)
Returns identifies the primary service provider (e.g. ‘ld4l_cache’, ‘direct’, etc.).
12 13 14 |
# File 'app/models/qa_server/authority_scenario.rb', line 12 def service @service end |
#subauthority_name ⇒ String (readonly)
Returns name of the subauthority the scenario runs against (e.g. ‘person’).
15 16 17 |
# File 'app/models/qa_server/authority_scenario.rb', line 15 def @subauthority_name end |
Instance Method Details
#context? ⇒ Boolean
36 37 38 |
# File 'app/models/qa_server/authority_scenario.rb', line 36 def context? @context end |