Sha256: a37b6379d6a2c494c0ebe0630aeb809f18e5d34d5ab8a35344d141716049fff8

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 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 eval("Geocoder::Store::" + geocoder_module_name)
        end
        @geocoder_options.merge! options
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geocoder-1.0.2 lib/geocoder/models/base.rb
geocoder-1.0.1 lib/geocoder/models/base.rb