Class: Vatsim::Prefile

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

Overview

Prefiled clients

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ Prefile

Returns a new instance of Prefile.



6
7
8
9
10
11
12
13
14
# File 'lib/vatsim/prefile.rb', line 6

def initialize line
  attributes = [:callsign, :cid, :realname, :clienttype, :frequency, :latitude, :longitude, :altitude, :groundspeed, :planned_aircraft, :planned_tascruise, :planned_depairport, :planned_altitude, :planned_destairport, :server, :protrevision, :rating, :transponder, :facilitytype, :visualrange, :planned_revision, :planned_flighttype, :planned_deptime, :planned_actdeptime, :planned_hrsenroute, :planned_minenroute, :planned_hrsfuel, :planned_minfuel, :planned_altairport, :planned_remarks, :planned_route, :planned_depairport_lat, :planned_depairport_lon, :planned_destairport_lat, :planned_destairport_lon, :atis_message, :time_last_atis_received, :time_logon, :heading, :QNH_iHg, :QNH_Mb]

  line_split = line.split(":")

  attributes.each_with_index.map { |attribute, index|
    instance_variable_set("@#{attribute}", line_split[index]) if self.respond_to?(attribute)
  }
end

Instance Attribute Details

#callsignObject (readonly)

Returns the value of attribute callsign.



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

def callsign
  @callsign
end

#cidObject (readonly)

Returns the value of attribute cid.



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

def cid
  @cid
end

#planned_actdeptimeObject (readonly)

Returns the value of attribute planned_actdeptime.



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

def planned_actdeptime
  @planned_actdeptime
end

#planned_aircraftObject (readonly)

Returns the value of attribute planned_aircraft.



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

def planned_aircraft
  @planned_aircraft
end

#planned_altairportObject (readonly)

Returns the value of attribute planned_altairport.



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

def planned_altairport
  @planned_altairport
end

#planned_altitudeObject (readonly)

Returns the value of attribute planned_altitude.



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

def planned_altitude
  @planned_altitude
end

#planned_depairportObject (readonly)

Returns the value of attribute planned_depairport.



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

def planned_depairport
  @planned_depairport
end

#planned_depairport_latObject (readonly)

Returns the value of attribute planned_depairport_lat.



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

def planned_depairport_lat
  @planned_depairport_lat
end

#planned_depairport_lonObject (readonly)

Returns the value of attribute planned_depairport_lon.



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

def planned_depairport_lon
  @planned_depairport_lon
end

#planned_deptimeObject (readonly)

Returns the value of attribute planned_deptime.



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

def planned_deptime
  @planned_deptime
end

#planned_destairportObject (readonly)

Returns the value of attribute planned_destairport.



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

def planned_destairport
  @planned_destairport
end

#planned_destairport_latObject (readonly)

Returns the value of attribute planned_destairport_lat.



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

def planned_destairport_lat
  @planned_destairport_lat
end

#planned_destairport_lonObject (readonly)

Returns the value of attribute planned_destairport_lon.



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

def planned_destairport_lon
  @planned_destairport_lon
end

#planned_flighttypeObject (readonly)

Returns the value of attribute planned_flighttype.



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

def planned_flighttype
  @planned_flighttype
end

#planned_hrsenrouteObject (readonly)

Returns the value of attribute planned_hrsenroute.



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

def planned_hrsenroute
  @planned_hrsenroute
end

#planned_hrsfuelObject (readonly)

Returns the value of attribute planned_hrsfuel.



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

def planned_hrsfuel
  @planned_hrsfuel
end

#planned_minenrouteObject (readonly)

Returns the value of attribute planned_minenroute.



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

def planned_minenroute
  @planned_minenroute
end

#planned_minfuelObject (readonly)

Returns the value of attribute planned_minfuel.



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

def planned_minfuel
  @planned_minfuel
end

#planned_remarksObject (readonly)

Returns the value of attribute planned_remarks.



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

def planned_remarks
  @planned_remarks
end

#planned_revisionObject (readonly)

Returns the value of attribute planned_revision.



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

def planned_revision
  @planned_revision
end

#planned_routeObject (readonly)

Returns the value of attribute planned_route.



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

def planned_route
  @planned_route
end

#planned_tascruiseObject (readonly)

Returns the value of attribute planned_tascruise.



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

def planned_tascruise
  @planned_tascruise
end

#realnameObject (readonly)

Returns the value of attribute realname.



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

def realname
  @realname
end