Method: Spider::Model::Query#initialize
- Defined in:
- lib/spiderfw/model/query.rb
#initialize(condition = nil, request = nil, &proc) ⇒ Query
Parameters are a Condition and a Request. If a block is given, it will be parsed by the Condition.
46 47 48 49 50 51 52 53 54 |
# File 'lib/spiderfw/model/query.rb', line 46 def initialize(condition = nil, request=nil, &proc) @condition = condition.is_a?(Condition) ? condition : Condition.new(condition) @request = request.is_a?(Request) ? request : Request.new(request) @polymorphs = [] @order = [] if (proc) @condition = Condition.new(&proc) end end |