Sha256: 0b99f136ce6dae987b75e473b185d52057d6ed7b1bdfb48149692aad4adf7460

Contents?: true

Size: 822 Bytes

Versions: 5

Compression:

Stored size: 822 Bytes

Contents

require 'geocoder'

module Geocoder

  ##
  # Methods for invoking Geocoder in a model.
  #
  module Model
    module Base

      def geocoder_options
        if defined?(@geocoder_options)
          @geocoder_options
        elsif superclass.respond_to?(:geocoder_options)
          superclass.geocoder_options
        end
      end

      def geocoded_by
        fail
      end

      def reverse_geocoded_by
        fail
      end


      private # ----------------------------------------------------------------

      def geocoder_init(options)
        unless @geocoder_options
          @geocoder_options = {}
          require "geocoder/stores/#{geocoder_file_name}"
          include Geocoder::Store.const_get(geocoder_module_name)
        end
        @geocoder_options.merge! options
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geocoder-1.1.1 lib/geocoder/models/base.rb
geocoder-1.1.0 lib/geocoder/models/base.rb
geocoder-1.0.5 lib/geocoder/models/base.rb
geocoder-1.0.4 lib/geocoder/models/base.rb
geocoder-1.0.3 lib/geocoder/models/base.rb