Sha256: 35fe20e323ef33dad321971cf16c85af01e62f3a4b22c97ae70ddc98e1b16ae7

Contents?: true

Size: 960 Bytes

Versions: 14

Compression:

Stored size: 960 Bytes

Contents

require 'geocoder/results/base'

module Geocoder::Result
  class DbIpCom < Base

    def coordinates
      ['latitude', 'longitude'].map{ |coordinate_name| @data[coordinate_name] }
    end

    def city
      @data['city']
    end

    def district
      @data['district']
    end

    def state_code
      @data['stateProvCode']
    end
    alias_method :state, :state_code

    def zip_code
      @data['zipCode']
    end
    alias_method :postal_code, :zip_code

    def country_name
      @data['countryName']
    end
    alias_method :country, :country_name

    def country_code
      @data['countryCode']
    end

    def continent_name
      @data['continentName']
    end
    alias_method :continent, :continent_name

    def continent_code
      @data['continentCode']
    end

    def time_zone
      @data['timeZone']
    end

    def gmt_offset
      @data['gmtOffset']
    end

    def currency_code
      @data['currencyCode']
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
geocoder-1.8.3 lib/geocoder/results/db_ip_com.rb
geocoder-1.8.2 lib/geocoder/results/db_ip_com.rb
geocoder-1.8.1 lib/geocoder/results/db_ip_com.rb
geocoder-1.8.0 lib/geocoder/results/db_ip_com.rb
geocoder-1.7.5 lib/geocoder/results/db_ip_com.rb
geocoder-1.7.4 lib/geocoder/results/db_ip_com.rb
geocoder-1.7.3 lib/geocoder/results/db_ip_com.rb
geocoder-1.7.2 lib/geocoder/results/db_ip_com.rb
geocoder-1.7.1 lib/geocoder/results/db_ip_com.rb
geocoder-1.7.0 lib/geocoder/results/db_ip_com.rb
geocoder-1.6.7 lib/geocoder/results/db_ip_com.rb
geocoder-1.6.6 lib/geocoder/results/db_ip_com.rb
geocoder-1.6.5 lib/geocoder/results/db_ip_com.rb
geocoder-1.6.4 lib/geocoder/results/db_ip_com.rb