Class: Wongi::Engine::Query
- Inherits:
-
GenericProductionRule
- Object
- GenericProductionRule
- Wongi::Engine::Query
- Defined in:
- lib/wongi-engine/dsl/query.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
Attributes inherited from GenericProductionRule
Instance Method Summary collapse
- #import_into(model) ⇒ Object
-
#initialize(name) ⇒ Query
constructor
A new instance of Query.
- #search_on(*terms) ⇒ Object
Methods inherited from GenericProductionRule
Methods included from DSLExtensions
Constructor Details
#initialize(name) ⇒ Query
Returns a new instance of Query.
7 8 9 10 |
# File 'lib/wongi-engine/dsl/query.rb', line 7 def initialize name super @parameters = [] end |
Instance Attribute Details
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
5 6 7 |
# File 'lib/wongi-engine/dsl/query.rb', line 5 def parameters @parameters end |
Instance Method Details
#import_into(model) ⇒ Object
16 17 18 19 20 |
# File 'lib/wongi-engine/dsl/query.rb', line 16 def import_into model copy = super copy.search_on *@parameters copy end |
#search_on(*terms) ⇒ Object
12 13 14 |
# File 'lib/wongi-engine/dsl/query.rb', line 12 def search_on *terms terms.each { |term| @parameters << term } end |