Class: ElasticGraph::SchemaDefinition::SchemaElements::SortOrderEnumValue

Inherits:
EnumValue
  • Object
show all
Defined in:
lib/elastic_graph/schema_definition/schema_elements/sort_order_enum_value.rb

Overview

Simple wrapper around an EnumValue so that we can expose the ‘sort_order_field_path` to Field customization callbacks.

Instance Attribute Summary collapse

Attributes inherited from EnumValue

#name, #runtime_metadata, #schema_def_state

Attributes included from Mixins::HasDocumentation

#doc_comment

Instance Method Summary collapse

Methods inherited from EnumValue

#duplicate_on, #to_sdl, #update_runtime_metadata

Methods included from Mixins::HasDirectives

#directive, #directives, #directives_sdl

Methods included from Mixins::HasDocumentation

#append_to_documentation, #derived_documentation, #documentation, #formatted_documentation

Methods included from Mixins::VerifiesGraphQLName

verify_name!

Constructor Details

#initialize(enum_value, sort_order_field_path) ⇒ SortOrderEnumValue

Returns a new instance of SortOrderEnumValue.



26
27
28
29
30
31
32
# File 'lib/elastic_graph/schema_definition/schema_elements/sort_order_enum_value.rb', line 26

def initialize(enum_value, sort_order_field_path)
  # We've told steep that SortOrderEnumValue is subclass of EnumValue
  # but here are supering to the `DelegateClass`'s initialize, not `EnumValue`'s,
  # so we have to use `__skip__`
  __skip__ = super(enum_value)
  @sort_order_field_path = sort_order_field_path
end

Instance Attribute Details

#sort_order_field_pathArray<Field> (readonly)

Returns path to the field from the root of the indexed ObjectType.

Returns:

  • (Array<Field>)

    path to the field from the root of the indexed ObjectType



23
24
25
# File 'lib/elastic_graph/schema_definition/schema_elements/sort_order_enum_value.rb', line 23

def sort_order_field_path
  @sort_order_field_path
end