Class: NOTAM::G

Inherits:
Item
  • Object
show all
Defined in:
lib/notam/item/g.rb

Overview

The G item defines the upper limit for this NOTAM.

Constant Summary collapse

RE =
%r(
  \A
  G\)\s?
  (?<all>
    SFC|GND|UNL|
    (?<value>\d+)\s?(?<unit>FT|M)\s?(?<base>AMSL|AGL)|
    (?<unit>FL)\s?(?<value>\d+)
  )
  \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

#mergeObject

See Also:



29
30
31
# File 'lib/notam/item/g.rb', line 29

def merge
  super(:upper_limit)
end

#upper_limitAIXM::Z

Returns:

  • (AIXM::Z)


20
21
22
23
24
25
26
# File 'lib/notam/item/g.rb', line 20

def upper_limit
  case captures['all']
    when 'UNL' then AIXM::UNLIMITED
    when 'SFC', 'GND' then AIXM::GROUND
    else limit(*captures.values_at('value', 'unit', 'base'))
  end
end