Module: Eql
- Defined in:
- lib/eql.rb,
lib/eql/proxy.rb,
lib/eql/config.rb,
lib/eql/builder.rb,
lib/eql/version.rb,
lib/eql/adapters/base.rb,
lib/eql/adapter_factory.rb,
lib/eql/template_loader.rb,
lib/eql/adapters/active_record.rb
Overview
Eql module renders ERB query templates and runs them
Defined Under Namespace
Modules: Adapters Classes: AdapterFactory, Builder, Config, Proxy, TemplateLoader
Constant Summary collapse
- VERSION =
Returns gem version
'0.1.0'
Class Method Summary collapse
- .config ⇒ Eql::Config
-
.configure {|config| ... } ⇒ Object
Setup.
-
.execute(tmpl, params = nil) ⇒ Object
Execute a builder with template and params.
-
.load(tmpl, params = nil) ⇒ Eql::Builder
Load a builder with template and params.
-
.new(path = nil, conn = nil) ⇒ Object
Create new builder.
- .register_adapter(key, klass) ⇒ Object
-
.template(erb) ⇒ Eql::Builder
Load a builder with template content.
Class Method Details
.configure {|config| ... } ⇒ Object
Setup
64 65 66 |
# File 'lib/eql.rb', line 64 def configure yield(config) end |
.execute(tmpl, params = nil) ⇒ Object
Execute a builder with template and params
39 40 41 |
# File 'lib/eql.rb', line 39 def execute(tmpl, params = nil) load(tmpl, params).execute end |
.load(tmpl, params = nil) ⇒ Eql::Builder
Load a builder with template and params
27 28 29 |
# File 'lib/eql.rb', line 27 def load(tmpl, params = nil) new.tap { |b| b.load(tmpl, params) } end |
.new(path = nil, conn = nil) ⇒ Object
Create new builder
15 16 17 |
# File 'lib/eql.rb', line 15 def new(path = nil, conn = nil) Builder.new(path || config.path, conn) end |
.register_adapter(key, klass) ⇒ Object
71 72 73 |
# File 'lib/eql.rb', line 71 def register_adapter(key, klass) AdapterFactory.register_adapter(key, klass) end |
.template(erb) ⇒ Eql::Builder
Load a builder with template content
50 51 52 |
# File 'lib/eql.rb', line 50 def template(erb) new.tap { |b| b.template(erb) } end |