lib/aixm/component/helipad.rb in aixm-1.1.0 vs lib/aixm/component/helipad.rb in aixm-1.2.0
- old
+ new
@@ -23,10 +23,12 @@
#
# @see https://gitlab.com/openflightmaps/ofmx/wikis/Airport#tla-helipad-tlof
class Helipad < Component
include AIXM::Association
include AIXM::Memoize
+ include AIXM::Concerns::Marking
+ include AIXM::Concerns::Remarks
PERFORMANCE_CLASSES = {
'1': :'1',
'2': :'2',
'3': :'3',
@@ -66,34 +68,61 @@
# @!method airport
# @return [AIXM::Feature::Airport] airport this helipad belongs to
belongs_to :airport
- # @return [String] full name (e.g. "H1")
+ # Full name (e.g. "H1")
+ #
+ # @overload name
+ # @return [String]
+ # @overload name=(value)
+ # @param value [String]
attr_reader :name
- # @return [AIXM::XY] center point
+ # Center point
+ #
+ # @overload center_xy
+ # @return [AIXM::XY]
+ # @overload center_xy=(value)
+ # @param value [AIXM::XY]
attr_reader :xy
- # @return [AIXM::Z, nil] elevation in +:qnh+
+ # Elevation in +:qnh+
+ #
+ # @overload z
+ # @return [AIXM::Z, nil]
+ # @overload z=(value)
+ # @param value [AIXM::Z, nil]
attr_reader :z
- # @return [AIXM::R, nil] dimensions
+ # Dimensions
+ #
+ # @overload dimensions
+ # @return [AIXM::R, nil]
+ # @overload dimensions=(value)
+ # @param value [AIXM::R, nil]
attr_reader :dimensions
- # @return [String, nil] markings
- attr_reader :marking
-
- # @return [Integer, Symbol, nil] suitable performance class
+ # Suitable performance class
+ #
+ # @overload performance_class
+ # @return [Integer, Symbol, nil]
+ # @overload performance_class=(value)
+ # @param value [Integer, Symbol, nil]
attr_reader :performance_class
- # @return [Symbol, nil] status of the helipad (see {STATUSES}) or +nil+ for normal operation
+ # Status of the helipad
+ #
+ # @overload status
+ # @return [Symbol, nil] any of {STATUSES} or +nil+ for normal operation
+ # @overload status=(value)
+ # @param value [Symbol, nil] any of {STATUSES} or +nil+ for normal
+ # operation
attr_reader :status
- # @return [String, nil] free text remarks
- attr_reader :remarks
-
+ # See the {cheat sheet}[AIXM::Component::Helipad] for examples on how to
+ # create instances of this class.
def initialize(name:, xy:)
self.name, self.xy = name, xy
self.surface = AIXM.surface
end
@@ -120,23 +149,15 @@
def dimensions=(value)
fail(ArgumentError, "invalid dimensions") unless value.nil? || value.is_a?(AIXM::R)
@dimensions = value
end
- def marking=(value)
- @marking = value&.to_s
- end
-
def performance_class=(value)
@performance_class = value.nil? ? nil : (PERFORMANCE_CLASSES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid performance class"))
end
def status=(value)
@status = value.nil? ? nil : (STATUSES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid status"))
- end
-
- def remarks=(value)
- @remarks = value&.to_s
end
# @return [String] UID markup
def to_uid
builder = Builder::XmlMarkup.new(indent: 2)