Class: NOTAM::E

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

Overview

The E item contains a textual description of what this NOTAM is all about.

Constant Summary collapse

RE =
%r(
  \A
  E\)\s?
  (?<content>.+)
  \z
)mx.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

#contentObject



15
16
17
# File 'lib/notam/item/e.rb', line 15

def content
  captures['content']
end

#mergeObject

See Also:



26
27
28
# File 'lib/notam/item/e.rb', line 26

def merge
  super(:content, :translated_content)
end

#translated_contentObject



19
20
21
22
23
# File 'lib/notam/item/e.rb', line 19

def translated_content
  content.split(/\b/).map do |word|
    (NOTAM::expand(word, translate: true) || word).upcase
  end.join
end