Sha256: 39270996b150588ffa1c7aae2b036aaf59257b3145f1d83efbbb0d579406a46d

Contents?: true

Size: 752 Bytes

Versions: 16

Compression:

Stored size: 752 Bytes

Contents

# 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 = {:Make => "porsche"}
# range_request.search_request = search_request
# range_request.fields = ['year', 'price']
#
class RangeRequest < Struct.new(:search_request, :fields)

  def add_field(field)
    fields << field
  end

  def query_params
    query_params = search_request.query_params
    query_params += "fields=#{CGI.escape(fields.join(','))}"
    query_params
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
threetaps-client-1.0.14 lib/dto/search/range_request.rb
threetaps-client-1.0.13 lib/dto/search/range_request.rb
threetaps-client-1.0.12 lib/dto/search/range_request.rb
threetaps-client-1.0.11 lib/dto/search/range_request.rb
threetaps-client-1.0.10 lib/dto/search/range_request.rb
threetaps-client-1.0.9 lib/dto/search/range_request.rb
threetaps-client-1.0.8 lib/dto/search/range_request.rb
threetaps-client-1.0.7 lib/dto/search/range_request.rb
threetaps-client-1.0.6 lib/dto/search/range_request.rb
threetaps-client-1.0.5 lib/dto/search/range_request.rb
threetaps-client-1.0.4 lib/dto/search/range_request.rb
threetaps-client-1.0.3 lib/dto/search/range_request.rb
threetaps-client-1.0.2 lib/dto/search/range_request.rb
threetaps-client-1.0.1 lib/dto/search/range_request.rb
threetaps-client-1.0.0 lib/dto/search/range_request.rb
threetaps-client-0.5.1 lib/dto/search/range_request.rb