Class: OpenWeatherMap::City

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

Overview

Represents a city

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, lon, lat, country) ⇒ City

Create a new City object



19
20
21
22
23
# File 'lib/openweathermap/classes.rb', line 19

def initialize(name, lon, lat, country)
  @name = name
  @coordinates = OpenWeatherMap::Coordinates.new(lon, lat)
  @country = country
end

Instance Attribute Details

#coordinates ⇒ Coordinates (readonly)



8
9
10
# File 'lib/openweathermap/classes.rb', line 8

def coordinates
  @coordinates
end

#country ⇒ String (readonly)



11
12
13
# File 'lib/openweathermap/classes.rb', line 11

def country
  @country
end

#name ⇒ String (readonly)



5
6
7
# File 'lib/openweathermap/classes.rb', line 5

def name
  @name
end