Method: Spider::Model::Request#initialize

Defined in:
lib/spiderfw/model/request.rb

#initialize(val = nil, params = {}) ⇒ Request

Returns a new instance of Request.

Parameters:

  • value (Array|Hash)

    Value to initialize the Request with. May be a Hash, or an Array of elements.

  • params (Hash) (defaults to: {})

    Params may have:

    • :total_rows Request the total rows corresponding to the Query from the storage



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/spiderfw/model/request.rb', line 19

def initialize(val=nil, params={})
    if (val.is_a?(Array))
        super()
        val.each{ |v| request(v) }
    else
        super(val)
    end
    @total_rows = params[:total_rows]
    @polymorphs = {}
    @expandable = true
end