Class: NOTAM::C

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

Overview

The C item defines when the NOTAM expires.

Constant Summary collapse

RE =
%r(
  \A
  C\)\s?
  (?<permanent>
    PERM|
    (?<expiration_at>#{TIME_RE}) \s? (?<estimated>EST)?
  )
  \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

#estimated_expiration?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/notam/item/c.rb', line 24

def estimated_expiration?
  !captures['estimated'].nil?
end

#expiration_atTime?

Returns:

  • (Time, nil)


19
20
21
# File 'lib/notam/item/c.rb', line 19

def expiration_at
  time(captures['expiration_at']) unless no_expiration?
end

#mergeObject

See Also:



34
35
36
# File 'lib/notam/item/c.rb', line 34

def merge
  super(:expiration_at, :estimated_expiration?, :no_expiration?)
end

#no_expiration?Boolean

Returns:

  • (Boolean)


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

def no_expiration?
  captures['permanent'] == 'PERM'
end