Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/geocoding_lite/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#geocoding_lookupObject

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
# File 'lib/geocoding_lite/core_extensions.rb', line 8

def geocoding_lookup
  raise ArgumentError, 'Wrong array size (expected 2 elements)' unless size.eql?(2)
  raise ArgumentError, 'Wrong coordinates (Float expected)' unless 
    self[0].kind_of?(Numeric) && self[1].kind_of?(Numeric)

  GeocodingLite.lookup(self)
end