Class: Arbor::Query
- Inherits:
-
Object
- Object
- Arbor::Query
- Defined in:
- lib/arbor/query.rb
Instance Attribute Summary collapse
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
- #add_filter(*args) ⇒ Object
- #build_query_string ⇒ Object
-
#initialize(filters = []) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(filters = []) ⇒ Query
Returns a new instance of Query.
8 9 10 |
# File 'lib/arbor/query.rb', line 8 def initialize(filters = []) @filters = filters end |
Instance Attribute Details
#filters ⇒ Object
Returns the value of attribute filters.
6 7 8 |
# File 'lib/arbor/query.rb', line 6 def filters @filters end |
#resource ⇒ Object
Returns the value of attribute resource.
6 7 8 |
# File 'lib/arbor/query.rb', line 6 def resource @resource end |
Instance Method Details
#add_filter(*args) ⇒ Object
16 17 18 |
# File 'lib/arbor/query.rb', line 16 def add_filter(*args) @filters << Arbor::Filter.new(*args) end |
#build_query_string ⇒ Object
12 13 14 |
# File 'lib/arbor/query.rb', line 12 def build_query_string URI.escape(filters.map(&:to_s).join("&")) end |