Sha256: 76ca492b6dd68880bcbb6b9d8dbd5d2f1d284bf155621b4314649c82b01ae4c8

Contents?: true

Size: 259 Bytes

Versions: 5

Compression:

Stored size: 259 Bytes

Contents

# frozen_string_literal: true

require 'geocoder'

# add on for the atome method
class Atome
  def geolocation
    # native version
    public_ip = `curl https://api.ipify.org`
    results = Geocoder.search(public_ip)
    results.first.coordinates
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
atome-0.5.1.9 lib/atome/extensions/geolocation.rb
atome-0.5.1.4 lib/atome/extensions/geolocation.rb
atome-0.5.1.1 lib/atome/extensions/geolocation.rb
atome-0.4.7.0 lib/atome/kernel/helpers/geolocation.rb
atome-0.4.5.4 lib/atome/extensions/geolocation.rb