Class: Airport_record
- Inherits:
-
Object
- Object
- Airport_record
- Defined in:
- lib/airport_record.rb
Instance Attribute Summary collapse
-
#facility_name ⇒ Object
Returns the value of attribute facility_name.
-
#icao ⇒ Object
Returns the value of attribute icao.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#location_identifier ⇒ Object
Returns the value of attribute location_identifier.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#tower ⇒ Object
Returns the value of attribute tower.
Instance Method Summary collapse
- #has_tower? ⇒ Boolean
-
#initialize(apt_line) ⇒ Airport_record
constructor
A new instance of Airport_record.
Constructor Details
#initialize(apt_line) ⇒ Airport_record
Returns a new instance of Airport_record.
6 7 8 9 10 11 12 13 |
# File 'lib/airport_record.rb', line 6 def initialize(apt_line) self.location_identifier = apt_line[27,4].strip self.facility_name = apt_line[133,42].strip self.latitude = apt_line[515,15].strip self.longitude = apt_line[542,15].strip self.tower = apt_line[989,1].strip self.icao = apt_line[1254,7].strip end |
Instance Attribute Details
#facility_name ⇒ Object
Returns the value of attribute facility_name.
4 5 6 |
# File 'lib/airport_record.rb', line 4 def facility_name @facility_name end |
#icao ⇒ Object
Returns the value of attribute icao.
4 5 6 |
# File 'lib/airport_record.rb', line 4 def icao @icao end |
#latitude ⇒ Object
Returns the value of attribute latitude.
4 5 6 |
# File 'lib/airport_record.rb', line 4 def latitude @latitude end |
#location_identifier ⇒ Object
Returns the value of attribute location_identifier.
4 5 6 |
# File 'lib/airport_record.rb', line 4 def location_identifier @location_identifier end |
#longitude ⇒ Object
Returns the value of attribute longitude.
4 5 6 |
# File 'lib/airport_record.rb', line 4 def longitude @longitude end |
#tower ⇒ Object
Returns the value of attribute tower.
4 5 6 |
# File 'lib/airport_record.rb', line 4 def tower @tower end |
Instance Method Details
#has_tower? ⇒ Boolean
15 16 17 |
# File 'lib/airport_record.rb', line 15 def has_tower? return self.tower == 'Y' ? true : false end |