Class: ACIrb::Query
- Inherits:
-
Object
- Object
- ACIrb::Query
- Defined in:
- lib/query.rb
Overview
Generic Query Interface
Direct Known Subclasses
Instance Attribute Summary collapse
-
#class_filter ⇒ Object
Returns the value of attribute class_filter.
-
#include_prop ⇒ Object
Returns the value of attribute include_prop.
-
#page ⇒ Object
Returns the value of attribute page.
-
#page_size ⇒ Object
Returns the value of attribute page_size.
-
#prop_filter ⇒ Object
Returns the value of attribute prop_filter.
-
#query_target ⇒ Object
Returns the value of attribute query_target.
-
#sort_order ⇒ Object
Returns the value of attribute sort_order.
-
#subscribe ⇒ Object
Returns the value of attribute subscribe.
-
#subtree ⇒ Object
Returns the value of attribute subtree.
-
#subtree_class_filter ⇒ Object
Returns the value of attribute subtree_class_filter.
-
#subtree_include ⇒ Object
Returns the value of attribute subtree_include.
-
#subtree_prop_filter ⇒ Object
Returns the value of attribute subtree_prop_filter.
Instance Method Summary collapse
Instance Attribute Details
#class_filter ⇒ Object
Returns the value of attribute class_filter.
8 9 10 |
# File 'lib/query.rb', line 8 def class_filter @class_filter end |
#include_prop ⇒ Object
Returns the value of attribute include_prop.
8 9 10 |
# File 'lib/query.rb', line 8 def include_prop @include_prop end |
#page ⇒ Object
Returns the value of attribute page.
8 9 10 |
# File 'lib/query.rb', line 8 def page @page end |
#page_size ⇒ Object
Returns the value of attribute page_size.
8 9 10 |
# File 'lib/query.rb', line 8 def page_size @page_size end |
#prop_filter ⇒ Object
Returns the value of attribute prop_filter.
8 9 10 |
# File 'lib/query.rb', line 8 def prop_filter @prop_filter end |
#query_target ⇒ Object
Returns the value of attribute query_target.
8 9 10 |
# File 'lib/query.rb', line 8 def query_target @query_target end |
#sort_order ⇒ Object
Returns the value of attribute sort_order.
8 9 10 |
# File 'lib/query.rb', line 8 def sort_order @sort_order end |
#subscribe ⇒ Object
Returns the value of attribute subscribe.
8 9 10 |
# File 'lib/query.rb', line 8 def subscribe @subscribe end |
#subtree ⇒ Object
Returns the value of attribute subtree.
8 9 10 |
# File 'lib/query.rb', line 8 def subtree @subtree end |
#subtree_class_filter ⇒ Object
Returns the value of attribute subtree_class_filter.
8 9 10 |
# File 'lib/query.rb', line 8 def subtree_class_filter @subtree_class_filter end |
#subtree_include ⇒ Object
Returns the value of attribute subtree_include.
8 9 10 |
# File 'lib/query.rb', line 8 def subtree_include @subtree_include end |
#subtree_prop_filter ⇒ Object
Returns the value of attribute subtree_prop_filter.
8 9 10 |
# File 'lib/query.rb', line 8 def subtree_prop_filter @subtree_prop_filter end |
Instance Method Details
#make_options ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/query.rb', line 12 def query_params = [] query_params.push('rsp-subtree=%s' % @subtree) \ if @subtree query_params.push('target-subtree-class=%s' % @class_filter) \ if @class_filter query_params.push('query-target=%s' % @query_target) \ if @query_target query_params.push('rsp-subtree-class=%s' % @subtree_class_filter) \ if @subtree_class_filter query_params.push('query-target-filter=%s' % @prop_filter) \ if @prop_filter query_params.push('rsp-subtree-filter=%s' % @subtree_prop_filter) \ if @subtree_prop_filter query_params.push('rsp-subtree-include=%s' % @subtree_include) \ if @subtree_include query_params.push('page-size=%s' % @page_size) \ if @page_size query_params.push('page=%s' % @page) \ if @page query_params.push('order-by=%s' % @sort_order) \ if @sort_order query_params.push('rsp-prop-include=%s' % @include_prop) \ if @include_prop query_params.push('subscription=yes') \ if @subscribe if query_params.length > 0 '?' + query_params.join('&') else '' end end |