Sha256: 974415748ea231251a3da224242c54da643fef92bf58c4f533ce9ef388f9136e
Contents?: true
Size: 709 Bytes
Versions: 8
Compression:
Stored size: 709 Bytes
Contents
module Ratis class LocationTypeAhead def self.where(conditions={}) search_text = conditions.delete(:search) raise ArgumentError.new('You must provide some search text') unless search_text Ratis.all_conditions_used? conditions response = Request.get 'Locationtypeahead', { 'Search' => search_text.downcase } return "" unless response.success? response_code = response.to_hash[:locationtypeahead_response][:responsecode] locations = response.to_array :locationtypeahead_response, :items, :item locations.map do |location_hash| Ratis::LocationTypeAheadItem.new(location_hash.merge(responsecode: response_code)) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems