Class: DuffelAPI::Resources::Airport

Inherits:
BaseResource show all
Defined in:
lib/duffel_api/resources/airport.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseResource

#api_response

Constructor Details

#initialize(object, response = nil) ⇒ Airport

Returns a new instance of Airport.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/duffel_api/resources/airport.rb', line 37

def initialize(object, response = nil)
  @object = object

  @city = object["city"]
  @city_name = object["city_name"]
  @iata_code = object["iata_code"]
  @iata_country_code = object["iata_country_code"]
  @icao_code = object["icao_code"]
  @id = object["id"]
  @latitude = object["latitude"]
  @longitude = object["longitude"]
  @name = object["name"]
  @time_zone = object["time_zone"]

  super(object, response)
end

Instance Attribute Details

#cityHash? (readonly)

Returns:

  • (Hash, nil)


8
9
10
# File 'lib/duffel_api/resources/airport.rb', line 8

def city
  @city
end

#city_nameString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/duffel_api/resources/airport.rb', line 11

def city_name
  @city_name
end

#iata_codeString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/duffel_api/resources/airport.rb', line 14

def iata_code
  @iata_code
end

#iata_country_codeString (readonly)

Returns:

  • (String)


17
18
19
# File 'lib/duffel_api/resources/airport.rb', line 17

def iata_country_code
  @iata_country_code
end

#icao_codeString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/duffel_api/resources/airport.rb', line 20

def icao_code
  @icao_code
end

#idString (readonly)

Returns:

  • (String)


23
24
25
# File 'lib/duffel_api/resources/airport.rb', line 23

def id
  @id
end

#latitudeFloat (readonly)

Returns:

  • (Float)


26
27
28
# File 'lib/duffel_api/resources/airport.rb', line 26

def latitude
  @latitude
end

#longitudeFloat (readonly)

Returns:

  • (Float)


29
30
31
# File 'lib/duffel_api/resources/airport.rb', line 29

def longitude
  @longitude
end

#nameString (readonly)

Returns:

  • (String)


32
33
34
# File 'lib/duffel_api/resources/airport.rb', line 32

def name
  @name
end

#time_zoneString (readonly)

Returns:

  • (String)


35
36
37
# File 'lib/duffel_api/resources/airport.rb', line 35

def time_zone
  @time_zone
end