Class: NOTAM::Footer

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

Overview

The footer items contain meta information.

Constant Summary collapse

RE =
%r(
  \A
  (?<key>CREATED|SOURCE):\s*
  (?<value>.+)
  \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, #parse, #type, type

Constructor Details

This class inherits a constructor from NOTAM::Item

Instance Method Details

#inspectString

Returns:

  • (String)


35
36
37
# File 'lib/notam/item/footer.rb', line 35

def inspect
  %Q(#<#{self.class} "#{truncated_text(start: 0)}">)
end

#keyString

Returns:

  • (String)


16
17
18
# File 'lib/notam/item/footer.rb', line 16

def key
  captures['key'].downcase.to_sym
end

#mergeObject

See Also:



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

def merge
  data[key] = value
  self
end

#valueString, Time

Returns:

  • (String, Time)


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

def value
  case key
    when :created then Time.parse(captures['value'] + ' UTC')
    else captures['value']
  end
end