lib/keen/client.rb in keen-0.8.6 vs lib/keen/client.rb in keen-0.8.7

- old
+ new

@@ -78,19 +78,19 @@ def ensure_project_id! raise ConfigurationError, "Project ID must be set" unless self.project_id end def ensure_write_key! - raise ConfigurationError, "Write Key must be set for sending events" unless self.write_key + raise ConfigurationError, "Write Key must be set for this operation" unless self.write_key end def ensure_master_key! - raise ConfigurationError, "Master Key must be set for delete event collections" unless self.master_key + raise ConfigurationError, "Master Key must be set for this operation" unless self.master_key end def ensure_read_key! - raise ConfigurationError, "Read Key must be set for queries" unless self.read_key + raise ConfigurationError, "Read Key must be set for this operation" unless self.read_key end def api_event_collection_resource_path(event_collection) encoded_collection_name = Addressable::URI.escape(event_collection.to_s) encoded_collection_name.gsub! '/', '%2F' @@ -102,16 +102,10 @@ preprocess_timeframe(params) preprocess_group_by(params) preprocess_percentile(params) preprocess_property_names(params) - query_params = "" - params.each do |param, value| - query_params << "#{param}=#{CGI.escape(value)}&" - end - - query_params.chop! - query_params + params.map { |key, value| "#{key}=#{CGI.escape(value)}" }.join('&') end def preprocess_encodables(params) [:filters, :steps, :analyses].each do |key| if params.key?(key)