Method: ElasticGraph.define_schema
- Defined in:
- lib/elastic_graph/schema_definition/api.rb
.define_schema ⇒ Object
The main entry point for schema definition from ElasticGraph applications.
Call this API from a Ruby file configured as the ‘path_to_schema` (or from a Ruby file `load`ed from the `path_to_schema` file).
26 27 28 29 30 31 32 33 |
# File 'lib/elastic_graph/schema_definition/api.rb', line 26 def self.define_schema if (api_instance = ::Thread.current[:ElasticGraph_SchemaDefinition_API_instance]) yield api_instance else raise Errors::SchemaError, "No active `SchemaDefinition::API` instance is available. " \ "Let ElasticGraph load the schema definition files." end end |