Class: Rack::JSON::JSONQuery
- Inherits:
-
Object
- Object
- Rack::JSON::JSONQuery
- Defined in:
- lib/rackjson/json_query.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#resource_id ⇒ Object
Returns the value of attribute resource_id.
-
#selector ⇒ Object
Returns the value of attribute selector.
Instance Method Summary collapse
-
#initialize(query_string, options = {}) ⇒ JSONQuery
constructor
A new instance of JSONQuery.
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, ={}) @resource_id = [:resource_id] || nil @query_string = query_string @conditions = @query_string.split(/\[|\]/).compact.reject {|s| s.empty? } @options = {} @selector = {} build end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/rackjson/json_query.rb', line 4 def @options end |
#resource_id ⇒ Object
Returns the value of attribute resource_id.
4 5 6 |
# File 'lib/rackjson/json_query.rb', line 4 def resource_id @resource_id end |
#selector ⇒ Object
Returns the value of attribute selector.
4 5 6 |
# File 'lib/rackjson/json_query.rb', line 4 def selector @selector end |