Class: Airport_record

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

Returns the value of attribute facility_name.



4
5
6
# File 'lib/airport_record.rb', line 4

def facility_name
  @facility_name
end

#icaoObject

Returns the value of attribute icao.



4
5
6
# File 'lib/airport_record.rb', line 4

def icao
  @icao
end

#latitudeObject

Returns the value of attribute latitude.



4
5
6
# File 'lib/airport_record.rb', line 4

def latitude
  @latitude
end

#location_identifierObject

Returns the value of attribute location_identifier.



4
5
6
# File 'lib/airport_record.rb', line 4

def location_identifier
  @location_identifier
end

#longitudeObject

Returns the value of attribute longitude.



4
5
6
# File 'lib/airport_record.rb', line 4

def longitude
  @longitude
end

#towerObject

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/airport_record.rb', line 15

def has_tower?
  return self.tower == 'Y' ? true : false
end