Class: Airports::AirportInfo
- Inherits:
-
Object
- Object
- Airports::AirportInfo
- Defined in:
- lib/movlog/airport.rb
Overview
airport
Instance Attribute Summary collapse
-
#airports ⇒ Object
readonly
Returns the value of attribute airports.
-
#lat ⇒ Object
readonly
Returns the value of attribute lat.
-
#lng ⇒ Object
readonly
Returns the value of attribute lng.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ AirportInfo
constructor
A new instance of AirportInfo.
Constructor Details
#initialize(data) ⇒ AirportInfo
Returns a new instance of AirportInfo.
10 11 12 13 |
# File 'lib/movlog/airport.rb', line 10 def initialize(data) @location = data[:location] load_geocode(data[:geocode]) end |
Instance Attribute Details
#airports ⇒ Object (readonly)
Returns the value of attribute airports.
8 9 10 |
# File 'lib/movlog/airport.rb', line 8 def airports @airports end |
#lat ⇒ Object (readonly)
Returns the value of attribute lat.
7 8 9 |
# File 'lib/movlog/airport.rb', line 7 def lat @lat end |
#lng ⇒ Object (readonly)
Returns the value of attribute lng.
7 8 9 |
# File 'lib/movlog/airport.rb', line 7 def lng @lng end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/movlog/airport.rb', line 6 def location @location end |
Class Method Details
.find(location) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/movlog/airport.rb', line 15 def self.find(location) data = { location: location, geocode: GoogleMapApi.geocode(location) } new(data) end |