Sha256: 102bdea8687d9fd532172b396d60a07b0f2223ba9a8f90677de3ec12878f6cb7

Contents?: true

Size: 623 Bytes

Versions: 23

Compression:

Stored size: 623 Bytes

Contents

require 'geocoder/results/base'

module Geocoder::Result
  class IpdataCo < Base

    def city
      @data['city']
    end

    def state
      @data['region']
    end

    def state_code
      @data['region_code']
    end

    def country
      @data['country_name']
    end

    def country_code
      @data['country_code']
    end

    def postal_code
      @data['postal']
    end

    def self.response_attributes
      %w[ip asn organisation currency currency_symbol calling_code flag time_zone is_eu]
    end

    response_attributes.each do |a|
      define_method a do
        @data[a]
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
geocoder-1.8.3 lib/geocoder/results/ipdata_co.rb
geocoder-1.8.2 lib/geocoder/results/ipdata_co.rb
geocoder-1.8.1 lib/geocoder/results/ipdata_co.rb
geocoder-1.8.0 lib/geocoder/results/ipdata_co.rb
geocoder-1.7.5 lib/geocoder/results/ipdata_co.rb
geocoder-1.7.4 lib/geocoder/results/ipdata_co.rb
geocoder-1.7.3 lib/geocoder/results/ipdata_co.rb
geocoder-1.7.2 lib/geocoder/results/ipdata_co.rb
geocoder-1.7.1 lib/geocoder/results/ipdata_co.rb
geocoder-1.7.0 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.7 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.6 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.5 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.4 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.3 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.2 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.1 lib/geocoder/results/ipdata_co.rb
geocoder-1.6.0 lib/geocoder/results/ipdata_co.rb
geocoder-1.5.2 lib/geocoder/results/ipdata_co.rb
really-broken-geocoder-2.0.0 lib/geocoder/results/ipdata_co.rb