Module: ElasticGraph::Warehouse::SchemaDefinition::FactoryExtension Private

Defined in:
elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Extension module applied to ElasticGraph::SchemaDefinition::Factory to add warehouse field type support.

Instance Method Summary collapse

Instance Method Details

#new_enum_type(name) {|ElasticGraph::SchemaDefinition::SchemaElements::EnumType| ... } ⇒ ElasticGraph::SchemaDefinition::SchemaElements::EnumType

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.

Creates a new enum type with warehouse extensions.

Parameters:

  • name (String)

    the name of the enum type

Yields:

Returns:



28
29
30
31
32
33
34
35
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 28

def new_enum_type(name)
  super(name) do |type|
    type.extend EnumTypeExtension
    # :nocov: -- currently all invocations have a block
    yield type if block_given?
    # :nocov:
  end
end

#new_index(name, settings, type) {|ElasticGraph::SchemaDefinition::Indexing::Index| ... } ⇒ ElasticGraph::SchemaDefinition::Indexing::Index

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.

Creates a new index with warehouse extensions. Automatically creates a warehouse table with the same name as the index unless one is explicitly defined or the index is excluded from the warehouse.

Parameters:

  • name (String)

    the name of the index

  • settings (Hash)

    additional settings for the index

  • type (Object)

    the type this index is for

Yields:

Returns:



46
47
48
49
50
51
52
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 46

def new_index(name, settings, type, &block)
  super(name, settings, type) do |index|
    extended_index = index.extend IndexExtension # : ::ElasticGraph::SchemaDefinition::Indexing::Index & IndexExtension
    extended_index.warehouse_table(name)
    block&.call(extended_index)
  end
end

#new_interface_type(name) {|ElasticGraph::SchemaDefinition::SchemaElements::InterfaceType| ... } ⇒ ElasticGraph::SchemaDefinition::SchemaElements::InterfaceType

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.

Creates a new interface type with warehouse extensions.

Parameters:

  • name (String)

    the name of the interface type

Yields:

Returns:



59
60
61
62
63
64
65
66
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 59

def new_interface_type(name)
  super(name) do |type|
    type.extend ObjectInterfaceAndUnionExtension
    # :nocov: -- currently all invocations have a block
    yield type if block_given?
    # :nocov:
  end
end

#new_object_type(name) {|ElasticGraph::SchemaDefinition::SchemaElements::ObjectType| ... } ⇒ ElasticGraph::SchemaDefinition::SchemaElements::ObjectType

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.

Creates a new object type with warehouse extensions.

Parameters:

  • name (String)

    the name of the object type

Yields:

Returns:



73
74
75
76
77
78
79
80
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 73

def new_object_type(name)
  super(name) do |type|
    type.extend ObjectInterfaceAndUnionExtension
    # :nocov: -- currently all invocations have a block
    yield type if block_given?
    # :nocov:
  end
end

#new_resultsElasticGraph::SchemaDefinition::Results

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.

Creates a new Results instance with warehouse extensions.

Returns:



113
114
115
116
117
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 113

def new_results
  super.tap do |results|
    results.extend ResultsExtension
  end
end

#new_scalar_type(name) {|ElasticGraph::SchemaDefinition::SchemaElements::ScalarType| ... } ⇒ ElasticGraph::SchemaDefinition::SchemaElements::ScalarType

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.

Creates a new scalar type with warehouse extensions.

Parameters:

  • name (String)

    the name of the scalar type

Yields:

Returns:



87
88
89
90
91
92
93
94
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 87

def new_scalar_type(name)
  super(name) do |type|
    type.extend ScalarTypeExtension
    # :nocov: -- currently all invocations have a block
    yield type if block_given?
    # :nocov:
  end
end

#new_schema_artifact_managerElasticGraph::SchemaDefinition::SchemaArtifactManager

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.

Creates a new SchemaArtifactManager instance with warehouse extensions.

Returns:

  • (ElasticGraph::SchemaDefinition::SchemaArtifactManager)

    the created artifact manager



122
123
124
125
126
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 122

def new_schema_artifact_manager(...)
  super.tap do |manager|
    manager.extend SchemaArtifactManagerExtension
  end
end

#new_union_type(name) {|ElasticGraph::SchemaDefinition::SchemaElements::UnionType| ... } ⇒ ElasticGraph::SchemaDefinition::SchemaElements::UnionType

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.

Creates a new union type with warehouse extensions.

Parameters:

  • name (String)

    the name of the union type

Yields:

Returns:



101
102
103
104
105
106
107
108
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/factory_extension.rb', line 101

def new_union_type(name)
  super(name) do |type|
    type.extend ObjectInterfaceAndUnionExtension
    # :nocov: -- currently all invocations have a block
    yield type if block_given?
    # :nocov:
  end
end