Skip to content
Snippets Groups Projects
Commit 3e72c472 authored by Alex Reisner's avatar Alex Reisner
Browse files

Remove Geocoder.config method.

This requires a parameter to be accepted by the block passed to
Geocoder.configure, which means you don't need to remember that the
method is called "config"--you can call it whatever you want.
This behavior seems more standard for configuration blocks.
parent 31d6d8a8
No related branches found
No related tags found
No related merge requests found
......@@ -70,10 +70,6 @@ module Geocoder
private # -----------------------------------------------------------------
def config # :nodoc
Configuration.instance
end
##
# Get a Lookup object (which communicates with the remote geocoding API).
# Takes a search query and returns an IP or street address Lookup
......@@ -135,4 +131,3 @@ if defined?(Rails)
require "geocoder/railtie"
Geocoder::Railtie.insert
end
......@@ -7,7 +7,7 @@ module Geocoder
#
def self.configure(&block)
if block_given?
module_eval(&block)
block.call(Configuration.instance)
else
Configuration.instance
end
......
......@@ -3,7 +3,7 @@ require 'test_helper'
class CalculationsTest < Test::Unit::TestCase
def setup
Geocoder.configure do
Geocoder.configure do |config|
config.units = :mi
config.distances = :linear
end
......
......@@ -39,7 +39,7 @@ class ConfigurationTest < Test::Unit::TestCase
# --- Geocoder#configure distances configuration ---
def test_geocoder_configuration
# DSL
Geocoder.configure do
Geocoder.configure do |config|
config.units = :mi
config.distances = :linear
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment