Class: OpenWeatherMap::Coordinates

Inherits:
Object
  • Object
show all
Defined in:
lib/openweathermap/classes.rb

Overview

Represents a location’s coordinates

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lon, lat) ⇒ Coordinates

Create a new Coordinates object

Parameters:

  • lon (Float)

    Longitude of the location

  • lat (Float)

    Latitude of the location



61
62
63
64
# File 'lib/openweathermap/classes.rb', line 61

def initialize(lon, lat)
  @lon = lon
  @lat = lat
end

Instance Attribute Details

#latFloat (readonly)

Returns Latitude of the location.

Returns:

  • (Float)

    Latitude of the location



53
54
55
# File 'lib/openweathermap/classes.rb', line 53

def lat
  @lat
end

#lonFloat (readonly)

Returns Longitude of the location.

Returns:

  • (Float)

    Longitude of the location



48
49
50
# File 'lib/openweathermap/classes.rb', line 48

def lon
  @lon
end