Class: CukeModeler::Model
- Inherits:
-
Object
- Object
- CukeModeler::Model
- Includes:
- CQL::Queriable
- Defined in:
- lib/cql/model_dsl.rb
Overview
A monkey patch that allows models to be queried directly by having them use this gem’s query module.
Instance Attribute Summary
Attributes included from CQL::Queriable
Instance Method Summary collapse
-
#initialize(source_text = nil) ⇒ Model
constructor
Sets itself as the model’s query_root.
-
#original_initialize ⇒ Object
Hanging on to the original method so that it can be invoked and thus ensure that all of the normal, un-patched behavior occurs.
Methods included from CQL::Queriable
Constructor Details
#initialize(source_text = nil) ⇒ Model
Sets itself as the model’s query_root. Otherwise, as per the un-patched method.
17 18 19 20 21 |
# File 'lib/cql/model_dsl.rb', line 17 def initialize(source_text = nil) original_initialize(source_text) @query_root = self end |
Instance Method Details
#original_initialize ⇒ Object
Hanging on to the original method so that it can be invoked and thus ensure that all of the normal, un-patched behavior occurs
13 |
# File 'lib/cql/model_dsl.rb', line 13 alias_method :original_initialize, :initialize |