Sha256: 6659c2b6cba3d8afc3085a4873bd2c694a130a250013b469cdab98cc96a4f4a1
Contents?: true
Size: 346 Bytes
Versions: 73
Compression:
Stored size: 346 Bytes
Contents
# frozen_string_literal: true class Atome def geolocation localisation = {latitude: nil, longitude: nil} $window.navigator.geolocate.then do |pos| localisation[:latitude] = pos.coords.latitude localisation[:longitude] = pos.coords.longitude end.rescue do |err| p err localisation = nil end end end
Version data entries
73 entries across 73 versions & 1 rubygems