Class: RangeRequest
Overview
Returns the minium and maximum values currently in 3taps for the given fields that match the given Common Search Criteria. The purpose of the range method is to provide developers with sensible values for range-based UI filters.
range_request = RangeRequest.new search_request = SearchRequest.new search_request.category = ‘VAUT’ search_request.annotations = => “porsche” range_request.search_request = search_request range_request.fields = [‘year’, ‘price’]
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#search_request ⇒ Object
Returns the value of attribute search_request.
Instance Method Summary collapse
Methods inherited from Struct
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields
12 13 14 |
# File 'lib/dto/search/range_request.rb', line 12 def fields @fields end |
#search_request ⇒ Object
Returns the value of attribute search_request
12 13 14 |
# File 'lib/dto/search/range_request.rb', line 12 def search_request @search_request end |
Instance Method Details
#add_field(field) ⇒ Object
14 15 16 |
# File 'lib/dto/search/range_request.rb', line 14 def add_field(field) fields << field end |
#query_params ⇒ Object
18 19 20 21 22 |
# File 'lib/dto/search/range_request.rb', line 18 def query_params query_params = search_request.query_params query_params += "fields=#{CGI.escape(fields.join(','))}" query_params end |