Method: NOTAM::Item#initialize

Defined in:
lib/notam/item.rb

#initialize(text, data: {}) ⇒ NOTAM::Header, ...

Note:

Some NOTAM items (most notably D) depend on previous items for meaningful parsing and may fail if this information is not made available by passing the NOTAM message payload parsed so far as data.

Analyses the raw NOTAM item text and initialize the corresponding item object.

Examples:

NOTAM::Item.new('A0135/20 NOTAMN')   # => #<NOTAM::Head id="A0135/20">
NOTAM::Item.new('B) 0208231540')     # => #<NOTAM::B>
NOTAM::Item.new('foobar')            # => NOTAM::ParseError

Parameters:

  • text (String)
  • data (Hash) (defaults to: {})


47
48
49
# File 'lib/notam/item.rb', line 47

def initialize(text, data: {})
  @text, @data = text.strip, data
end