lib/aixm/component/approach_lighting.rb in aixm-1.1.0 vs lib/aixm/component/approach_lighting.rb in aixm-1.2.0
- old
+ new
@@ -17,10 +17,12 @@
#
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#rda-runway-direction-approach-lighting
class ApproachLighting < Component
include AIXM::Association
include AIXM::Memoize
+ include AIXM::Concerns::Intensity
+ include AIXM::Concerns::Remarks
TYPES = {
A: :cat_1,
B: :cat_2,
C: :cat_3,
@@ -39,39 +41,48 @@
AFOVRN: :usaf_overrun,
MILOVRN: :military_overrun,
OTHER: :other # specify in remarks
}.freeze
- INTENSITIES = {
- LIL: :low,
- LIM: :medium,
- LIH: :high,
- OTHER: :other # specify in remarks
- }.freeze
-
# @!method approach_lightable
# @return [AIXM::Component::Runway::Direction, AIXM::Component::FATO::Direction] approach lighted entity
belongs_to :approach_lightable
- # @return [Symbol, nil] type of the approach lighting system (see {TYPES})
+ # Type of the approach lighting system
+ #
+ # @overload type
+ # @return [Symbol] any of {TYPES}
+ # @overload type=(value)
+ # @param value [Symbol] any of {TYPES}
attr_reader :type
- # @return [AIXM::D, nil] length
+ # Length
+ #
+ # @overload length
+ # @return [AIXM::D, nil]
+ # @overload length=(value)
+ # @param value [AIXM::D, nil]
attr_reader :length
- # @return [Symbol, nil] intensity of lights (see {INTENSITIES})
- attr_reader :intensity
-
- # @return [Boolean, nil] whether sequenced flash is available
+ # Whether sequenced flash is available
+ #
+ # @overload sequenced_flash
+ # @return [Boolean, nil] +nil+ means unknown
+ # @overload sequenced_flash=(value)
+ # @param value [Boolean, nil] +nil+ means unknown
attr_reader :sequenced_flash
- # @return [String, nil] description of the flash sequence
+ # Description of the flash sequence
+ #
+ # @overload flash_description
+ # @return [String, nil]
+ # @overload flash_description=(value)
+ # @param value [String, nil]
attr_reader :flash_description
- # @return [String, nil] free text remarks
- attr_reader :remarks
-
+ # See the {cheat sheet}[AIXM::Component::ApproachLighting] for examples on
+ # how to create instances of this class.
def initialize(type:)
self.type = type
end
# @return [String]
@@ -86,24 +97,16 @@
def length=(value)
fail(ArgumentError, "invalid length") unless value.nil? || value.is_a?(AIXM::D)
@length = value
end
- def intensity=(value)
- @intensity = value.nil? ? nil : INTENSITIES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid intensity")
- end
-
def sequenced_flash=(value)
fail(ArgumentError, "invalid sequenced flash") unless [true, false, nil].include? value
@sequenced_flash = value
end
def flash_description=(value)
@flash_description = value&.to_s
- end
-
- def remarks=(value)
- @remarks = value&.to_s
end
# @return [String] UID markup
def to_uid(as:)
builder = Builder::XmlMarkup.new(indent: 2)