Class: QaServer::TermScenario
- Inherits:
-
AuthorityScenario
- Object
- AuthorityScenario
- QaServer::TermScenario
- Includes:
- ERB::Util
- Defined in:
- app/models/qa_server/term_scenario.rb
Constant Summary
Constants inherited from AuthorityScenario
AuthorityScenario::DEFAULT_SUBAUTH, AuthorityScenario::MIN_EXPECTED_SIZE
Instance Attribute Summary collapse
-
#identifier ⇒ String
readonly
Id or uri of the term being fetched by this scenario.
Attributes inherited from AuthorityScenario
#authority, #authority_name, #min_result_size, #service, #subauthority_name
Instance Method Summary collapse
-
#initialize(authority:, authority_name:, authority_scenario_config:, scenario_config:) ⇒ TermScenario
constructor
A new instance of TermScenario.
-
#url ⇒ String
Generate an example URL that can be called in a browser or through curl.
Methods inherited from AuthorityScenario
Constructor Details
#initialize(authority:, authority_name:, authority_scenario_config:, scenario_config:) ⇒ TermScenario
Returns a new instance of TermScenario.
16 17 18 19 20 21 |
# File 'app/models/qa_server/term_scenario.rb', line 16 def initialize(authority:, authority_name:, authority_scenario_config:, scenario_config:) super @identifier = scenario_config['identifier'] = scenario_config['subauth'] || DEFAULT_SUBAUTH @min_result_size = scenario_config['min_result_size'] || MIN_EXPECTED_SIZE end |
Instance Attribute Details
#identifier ⇒ String (readonly)
Returns id or uri of the term being fetched by this scenario.
10 11 12 |
# File 'app/models/qa_server/term_scenario.rb', line 10 def identifier @identifier end |
Instance Method Details
#url ⇒ String
Generate an example URL that can be called in a browser or through curl
25 26 27 |
# File 'app/models/qa_server/term_scenario.rb', line 25 def url .term_id_expects_uri? ? fetch_url : show_url end |