Class: ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::FieldReference Private
- Inherits:
-
SchemaDefinition::Indexing::FieldReference
- Object
- SchemaDefinition::Indexing::FieldReference
- ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::FieldReference
- Defined in:
- elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Wraps an indexing field reference with JSON schema state needed when resolving fields.
Instance Attribute Summary collapse
-
#doc_comment ⇒ String?
readonly
private
Documentation for the referenced field.
-
#json_schema_customizations ⇒ Hash<Symbol, Object>
readonly
private
User-defined JSON schema customizations.
-
#json_schema_layers ⇒ Array<Symbol>
readonly
private
JSON schema wrapper layers from the field type reference.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
private
Compares field references, including JSON schema metadata tracked by this wrapper.
- #eql?(other) ⇒ Boolean private
-
#hash ⇒ Integer
private
Returns a hash code based on the wrapped field reference and JSON schema metadata.
-
#initialize(field_reference, json_schema_layers:, json_schema_customizations:, doc_comment:) ⇒ FieldReference
constructor
private
A new instance of FieldReference.
-
#resolve ⇒ Field?
private
Resolves this reference to a JSON-schema-aware indexing field.
Constructor Details
#initialize(field_reference, json_schema_layers:, json_schema_customizations:, doc_comment:) ⇒ FieldReference
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FieldReference.
35 36 37 38 39 40 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 35 def initialize(field_reference, json_schema_layers:, json_schema_customizations:, doc_comment:) super(field_reference) @json_schema_layers = json_schema_layers @json_schema_customizations = json_schema_customizations @doc_comment = doc_comment end |
Instance Attribute Details
#doc_comment ⇒ String? (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns documentation for the referenced field.
29 30 31 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 29 def doc_comment @doc_comment end |
#json_schema_customizations ⇒ Hash<Symbol, Object> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns user-defined JSON schema customizations.
26 27 28 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 26 def json_schema_customizations @json_schema_customizations end |
#json_schema_layers ⇒ Array<Symbol> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns JSON schema wrapper layers from the field type reference.
23 24 25 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 23 def json_schema_layers @json_schema_layers end |
Instance Method Details
#==(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Compares field references, including JSON schema metadata tracked by this wrapper.
60 61 62 63 64 65 66 67 68 69 70 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 60 def ==(other) case other when FieldReference __getobj__ == other.__getobj__ && json_schema_layers == other.json_schema_layers && json_schema_customizations == other.json_schema_customizations && doc_comment == other.doc_comment else super end end |
#eql?(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
72 73 74 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 72 def eql?(other) self == other end |
#hash ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a hash code based on the wrapped field reference and JSON schema metadata.
79 80 81 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 79 def hash [__getobj__, json_schema_layers, json_schema_customizations, doc_comment].hash end |
#resolve ⇒ Field?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Resolves this reference to a JSON-schema-aware indexing field.
45 46 47 48 49 50 51 52 53 54 |
# File 'elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion/schema_definition/indexing/field_reference.rb', line 45 def resolve return nil unless (resolved_field = super) Field.new( resolved_field, json_schema_layers: json_schema_layers, json_schema_customizations: json_schema_customizations, doc_comment: doc_comment ) end |