Class: Rack::JSON::JSONQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/rackjson/json_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query_string, options = {}) ⇒ JSONQuery

Returns a new instance of JSONQuery.



6
7
8
9
10
11
12
13
# File 'lib/rackjson/json_query.rb', line 6

def initialize(query_string, options={})
  @resource_id = options[:resource_id] || nil
  @query_string = query_string
  @conditions = @query_string.split(/\[|\]/).compact.reject {|s| s.empty? }
  @options = {}
  @selector = {}
  build
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/rackjson/json_query.rb', line 4

def options
  @options
end

#resource_idObject

Returns the value of attribute resource_id.



4
5
6
# File 'lib/rackjson/json_query.rb', line 4

def resource_id
  @resource_id
end

#selectorObject

Returns the value of attribute selector.



4
5
6
# File 'lib/rackjson/json_query.rb', line 4

def selector
  @selector
end