lib/medea/jasondeferredquery.rb in medea-0.6.3 vs lib/medea/jasondeferredquery.rb in medea-0.6.4
- old
+ new
@@ -47,10 +47,23 @@
return
end
#return self, so that we can chain up query refinements
self
end
+
+ def limit n
+ self.filters[:TOP] = n
+ end
+
+ def limit= n
+ limit n
+ end
+
+ #synonym for limit
+ def top n
+ limit n
+ end
#end query interface
def add_data_filter property, value
self.filters[:DATA_FILTER] ||= {}
self.filters[:DATA_FILTER][property] = value
@@ -76,9 +89,11 @@
end
else
filter_array << URI.escape("#{name.to_s}=#{field.to_s}:#{value.to_s}", unsafe)
end
end
+ else
+ filter_array << URI.escape("#{name.to_s}=#{val.to_s}", unsafe)
end
end
end
url + filter_array.join("&")