Class: NOTAM::Q
Overview
The Q item provides the context such as the FIR or conditions.
Constant Summary
collapse
- RE =
%r(
\A
Q\)\s?
(?<fir>#{ICAO_RE})/
Q(?<subject>[A-Z]{2})(?<condition>[A-Z]{2})/
(?<traffic>IV|(?:[IVK]\s?))/
(?<purpose>NBO|BO\s?|(?:[BMK]\s{0,2}))/
(?<scope>A[EW]|(?:[AEWK]\s?))/
(?<lower_limit>\d{3})/
(?<upper_limit>\d{3})/
(?<lat_deg>\d{2})(?<lat_min>\d{2})(?<lat_dir>[NS])
(?<long_deg>\d{3})(?<long_min>\d{2})(?<long_dir>[EW])
(?<radius>\d{3})
\z
)x.freeze
Constants inherited
from Item
Item::ICAO_RE, Item::ID_RE, Item::TIME_RE
Instance Attribute Summary
Attributes inherited from Item
#captures, #data, #text
Instance Method Summary
collapse
Methods inherited from Item
#fail!, #initialize, #inspect, #parse, #type, type
Constructor Details
This class inherits a constructor from NOTAM::Item
Instance Method Details
#center_point ⇒ AIXM::XY
Returns approximately affected area center point.
81
82
83
84
85
86
|
# File 'lib/notam/item/q.rb', line 81
def center_point
AIXM.xy(
lat: %Q(#{captures['lat_deg']}°#{captures['lat_min']}'00"#{captures['lat_dir']}),
long: %Q(#{captures['long_deg']}°#{captures['long_min']}'00"#{captures['long_dir']})
)
end
|
#condition ⇒ Symbol
45
46
47
|
# File 'lib/notam/item/q.rb', line 45
def condition
NOTAM.condition_for(captures['condition'])
end
|
#condition_group ⇒ Symbol
40
41
42
|
# File 'lib/notam/item/q.rb', line 40
def condition_group
NOTAM.condition_group_for(captures['condition'][0,1])
end
|
#fir ⇒ String
25
26
27
|
# File 'lib/notam/item/q.rb', line 25
def fir
captures['fir']
end
|
#lower_limit ⇒ AIXM::Z
Returns lower limit (QNE flight level) or AIXM::GROUND (aka: 0ft QFE).
66
67
68
69
70
71
72
|
# File 'lib/notam/item/q.rb', line 66
def lower_limit
if (limit = captures['lower_limit'].to_i).zero?
AIXM::GROUND
else
AIXM.z(captures['lower_limit'].to_i, :qne)
end
end
|
#merge ⇒ Object
94
95
96
|
# File 'lib/notam/item/q.rb', line 94
def merge
super(:fir, :subject_group, :subject, :condition_group, :condition, :traffic, :purpose, :scope, :lower_limit, :upper_limit, :center_point, :radius)
end
|
#purpose ⇒ Array<Symbol>
55
56
57
|
# File 'lib/notam/item/q.rb', line 55
def purpose
captures['purpose'].strip.chars.map { NOTAM.purpose_for(_1) }
end
|
#radius ⇒ AIXM::D
Returns approximately affected area radius.
89
90
91
|
# File 'lib/notam/item/q.rb', line 89
def radius
AIXM.d(captures['radius'].to_i, :nm)
end
|
#scope ⇒ Array<Symbol>
60
61
62
|
# File 'lib/notam/item/q.rb', line 60
def scope
captures['scope'].strip.chars.map { NOTAM.scope_for(_1) }
end
|
#subject ⇒ Symbol
35
36
37
|
# File 'lib/notam/item/q.rb', line 35
def subject
NOTAM.subject_for(captures['subject'])
end
|
#subject_group ⇒ Symbol
30
31
32
|
# File 'lib/notam/item/q.rb', line 30
def subject_group
NOTAM.subject_group_for(captures['subject'][0,1])
end
|
#traffic ⇒ Symbol
50
51
52
|
# File 'lib/notam/item/q.rb', line 50
def traffic
NOTAM.traffic_for(captures['traffic'].strip)
end
|
#upper_limit ⇒ AIXM::Z
Returns upper limit (QNE flight level) or AIXM::UNLIMITED (aka: FL999 QNE).
76
77
78
|
# File 'lib/notam/item/q.rb', line 76
def upper_limit
AIXM.z(captures['upper_limit'].to_i, :qne)
end
|