Module: TZDetect::Geocoder::ClassMethods

Defined in:
lib/tzdetect/geocoder.rb

Class Method Summary collapse

Class Method Details

.get(country, city, region = "") ⇒ Object

Returns location position hash

*latitude
*longitude
*timezone - can be nil


27
28
29
30
# File 'lib/tzdetect/geocoder.rb', line 27

def self.get country, city, region=""
  location = self.new country, city, region
  location.position
end

.get!(country, city, region = "") ⇒ Object

Returns location position hash (raise exception)

*latitude
*longitude
*timezone - can be nil


38
39
40
41
# File 'lib/tzdetect/geocoder.rb', line 38

def self.get! country, city, region=""
  location = self.new country, city, region
  return location.position!
end