From e64151aecdb9210492129bff684b5c8d802906f1 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Mon, 21 Mar 2011 18:20:04 -0400 Subject: [PATCH] Remove deprecation warnings. ...for array methods mistakenly called on a Result object. This is no longer likely to be a problem now that Geocoder.search returns an array. --- lib/geocoder/results/base.rb | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/geocoder/results/base.rb b/lib/geocoder/results/base.rb index b24a0193..10844002 100644 --- a/lib/geocoder/results/base.rb +++ b/lib/geocoder/results/base.rb @@ -39,20 +39,6 @@ module Geocoder def country_code fail end - - def [](i) - if i == 0 - warn "DEPRECATION WARNING: You called '[0]' on a Geocoder::Result object. Geocoder.search(...) now returns a single result instead of an array so this is no longer necessary. This warning will be removed and an error will result in geocoder 1.0." - elsif i.is_a?(Fixnum) - warn "DEPRECATION WARNING: You tried to access a Geocoder result but Geocoder.search(...) now returns a single result instead of an array. This warning will be removed and an error will result in geocoder 1.0." - end - self - end - - def first - warn "DEPRECATION WARNING: You called '.first' on a Geocoder::Result object. Geocoder.search(...) now returns a single result instead of an array so this is no longer necessary. This warning will be removed and an error will result in geocoder 1.0." - self - end end end end -- GitLab