Class: Autoselect::AssertedEnvironment::Autoselect
- Includes:
- Operators
- Defined in:
- lib/autoselect/asserted_environment/autoselect.rb
Constant Summary
Constants included from Operators
Instance Attribute Summary
Attributes inherited from Base
#effective_term, #level_params, #operator, #project_id, #raw_term, #requested_level, #user_id
Instance Method Summary collapse
-
#levels ⇒ Object
Ordered level stack — defines the fuse escalation sequence.
- #resource_path ⇒ Object
-
#response_values(record) ⇒ Hash
AssertedEnvironment records are per-object (polymorphic) join rows, so, unlike other models, selecting a result never references its
id- a Fast- or Smart-level hit (an existing AssertedEnvironment) and an Envo-level hit (a pseudo-record, id: nil) all carry the same uri/uri_label shape here.
Methods included from Operators
Methods inherited from Base
#build_config, #config_response, #execute_level, #find_level, #format_results, #initialize, #level_map_keys, #next_level_key, #record_list_operator?, #response, #term_response
Methods included from Operators
Constructor Details
This class inherits a constructor from Autoselect::Base
Instance Method Details
#levels ⇒ Object
Ordered level stack — defines the fuse escalation sequence.
12 13 14 15 16 17 18 |
# File 'lib/autoselect/asserted_environment/autoselect.rb', line 12 def levels [ ::Autoselect::AssertedEnvironment::Levels::Fast.new, ::Autoselect::AssertedEnvironment::Levels::Smart.new, ::Autoselect::AssertedEnvironment::Levels::Envo.new, ] end |
#resource_path ⇒ Object
7 8 9 |
# File 'lib/autoselect/asserted_environment/autoselect.rb', line 7 def resource_path '/asserted_environments/autoselect' end |
#response_values(record) ⇒ Hash
AssertedEnvironment records are per-object (polymorphic) join rows, so,
unlike other models, selecting a result never references its id -
a Fast- or Smart-level hit (an existing AssertedEnvironment) and an
Envo-level hit (a pseudo-record, id: nil) all carry the same
uri/uri_label shape here. The client uses these to create a new
AssertedEnvironment for whatever object it is annotating.
28 29 30 |
# File 'lib/autoselect/asserted_environment/autoselect.rb', line 28 def response_values(record) { uri: record.uri, uri_label: record.uri_label } end |