Method: NOTAM::Item.type
- Defined in:
- lib/notam/item.rb
.type(text) ⇒ String
Analyses the raw NOTAM item text and detect its type.
70 71 72 73 74 75 76 77 |
# File 'lib/notam/item.rb', line 70 def type(text) case text.strip when /\A([A-GQ])\)/ then $1 when NOTAM::Header::RE then 'Header' when NOTAM::Footer::RE then 'Footer' else fail(NOTAM::ParseError, 'item not recognized') end.to_sym end |