File: ipinfo_io_lite.rb

package info (click to toggle)
ruby-geocoder 1.8.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 900 kB
  • sloc: ruby: 8,419; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 315 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'geocoder/results/base'

module Geocoder::Result
  class IpinfoIoLite < Base

    def self.response_attributes
      %w(ip asn as_name as_domain country country_code continent continent_code)
    end

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