class Aviateur::Parser
Public Class Methods
new(body)
click to toggle source
Calls superclass method
Aviateur::Base::new
# File lib/aviateur/parser.rb, line 9 def initialize(body) super body parse_keys end
Public Instance Methods
coordinate(name)
click to toggle source
# File lib/aviateur/parser.rb, line 32 def coordinate(name) flightdata(name).to_i.quo(1000).to_f end
flightdata(name)
click to toggle source
# File lib/aviateur/parser.rb, line 20 def flightdata(name) send "fltdata_#{name}" end
latitude()
click to toggle source
# File lib/aviateur/parser.rb, line 24 def latitude coordinate :present_position_latitude end
longitude()
click to toggle source
# File lib/aviateur/parser.rb, line 28 def longitude coordinate :present_position_longitude end
map_url_to_current_position()
click to toggle source
# File lib/aviateur/parser.rb, line 36 def map_url_to_current_position "https://www.google.co.jp/maps?q=#{latitude},#{longitude}" end
parse_keys()
click to toggle source
# File lib/aviateur/parser.rb, line 14 def parse_keys @raw.each do |k, v| instance_variable_set "@#{k.sub('td_id_','')}", v end end