lib/spiderfw/model/request.rb in spiderfw-0.5.7 vs lib/spiderfw/model/request.rb in spiderfw-0.5.9
- old
+ new
@@ -8,20 +8,23 @@
class Request < ModelHash
# (bool) if true, the total number of rows returned by the query is requested.
attr_accessor :total_rows
# (array) find also the given subclasses of the queried model.
attr_reader :polymorphs
+ # (bool) if true, the request will be expanded with lazy groups on load
+ attr_accessor :expandable
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
# TODO: fix/remove?
def request(element) # :nodoc:
if (element.is_a?(Element))
@@ -70,9 +73,13 @@
@with_superclass = val
end
def with_superclass?
@with_superclass
+ end
+
+ def expandable?
+ @expandable
end
end
\ No newline at end of file