Class: TableQuery::SchemaLoader
- Inherits:
-
Object
- Object
- TableQuery::SchemaLoader
- Defined in:
- lib/table-query/schema-loader.rb
Overview
SchemaLoader provides functions to load schema file and evaluation context.
Defined Under Namespace
Classes: Context, VariableQuery, VariableTable, VariableType
Class Method Summary collapse
-
.load(src, filename) ⇒ Object
Load schema file and evaluate.
Instance Method Summary collapse
-
#eval ⇒ Array<Array<Type>, TableSchema, Array<QuerySchema>>
Evaluate schema file.
-
#initialize(src, filename) ⇒ SchemaLoader
constructor
Create a new loader.
Constructor Details
#initialize(src, filename) ⇒ SchemaLoader
Create a new loader.
77 78 79 80 81 |
# File 'lib/table-query/schema-loader.rb', line 77 def initialize(src, filename) @src = src @filename = filename @context = Context.new end |
Class Method Details
.load(src, filename) ⇒ Object
Load schema file and evaluate.
67 68 69 |
# File 'lib/table-query/schema-loader.rb', line 67 def self.load(src, filename) new(src, filename).eval end |
Instance Method Details
#eval ⇒ Array<Array<Type>, TableSchema, Array<QuerySchema>>
Evaluate schema file.
87 88 89 90 |
# File 'lib/table-query/schema-loader.rb', line 87 def eval @context.binding.eval(@src, @filename) [@context.type.value, @context.table.value, @context.query.value] end |