app/models/concerns/katalyst/tables/collection/query/value_parser.rb in katalyst-tables-3.3.1 vs app/models/concerns/katalyst/tables/collection/query/value_parser.rb in katalyst-tables-3.3.2
- old
+ new
@@ -3,24 +3,29 @@
module Katalyst
module Tables
module Collection
module Query
class ValueParser
- attr_accessor :query
+ attr_accessor :query, :value
- def initialize(collection:, attribute:)
- @collection = collection
- @attribute = attribute
+ def initialize(start:)
+ @start = start
end
+ def range
+ @start..@end
+ end
+
def take_quoted_value
return unless query.scan(/"([^"]*)"/)
self.value, = query.values_at(1)
end
def take_unquoted_value
- return unless query.scan(/([^" \],]*)/)
+ # note, we allow unquoted values to begin with a " so that partial
+ # inputs can be accepted
+ return unless query.scan(/"?([^ \],]*)/)
self.value, = query.values_at(1)
end
def skip_whitespace