Class: AIXM::Feature Abstract

Inherits:
Component show all
Defined in:
lib/aixm/feature.rb,
lib/aixm/feature/unit.rb,
lib/aixm/feature/airport.rb,
lib/aixm/feature/generic.rb,
lib/aixm/feature/airspace.rb,
lib/aixm/feature/obstacle.rb,
lib/aixm/feature/organisation.rb,
lib/aixm/feature/obstacle_group.rb,
lib/aixm/feature/navigational_aid.rb,
lib/aixm/feature/navigational_aid/dme.rb,
lib/aixm/feature/navigational_aid/ndb.rb,
lib/aixm/feature/navigational_aid/vor.rb,
lib/aixm/feature/navigational_aid/tacan.rb,
lib/aixm/feature/navigational_aid/marker.rb,
lib/aixm/feature/navigational_aid/designated_point.rb

Overview

This class is abstract.

Defined Under Namespace

Classes: Airport, Airspace, Generic, NavigationalAid, Obstacle, ObstacleGroup, Organisation, Unit

Constant Summary collapse

REGION_RE =
/\A[A-Z]{2}\z/.freeze

Instance Attribute Summary collapse

Attributes inherited from Component

#meta

Instance Method Summary collapse

Methods included from Concerns::HashEquality

#eql?

Methods included from Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from Concerns::Memoize

method

Constructor Details

#initialize(source: nil, region: nil) ⇒ Feature

Returns a new instance of Feature.



36
37
38
39
# File 'lib/aixm/feature.rb', line 36

def initialize(source: nil, region: nil)
  self.source = source
  self.region = region || AIXM.config.region
end

Instance Attribute Details

#commentString #comment=(value) ⇒ Object

Freely usable XML comment e.g. to include raw source data

Overloads:

  • #commentString

    Returns:

    • (String)
  • #comment=(value) ⇒ Object

    Parameters:



18
19
20
# File 'lib/aixm/feature.rb', line 18

def comment
  @comment
end

#regionString #region=(value) ⇒ Object

OFMX region all features in this document belong to.

Overloads:

  • #regionString

    Returns:

    • (String)
  • #region=(value) ⇒ Object

    Parameters:

    • value (String)


34
35
36
# File 'lib/aixm/feature.rb', line 34

def region
  @region
end

#sourceString #source=(value) ⇒ Object

Reference to source of the feature data.

Overloads:

  • #sourceString

    Returns:

    • (String)
  • #source=(value) ⇒ Object

    Parameters:

    • value (String)


26
27
28
# File 'lib/aixm/feature.rb', line 26

def source
  @source
end

Instance Method Details

#==(other) ⇒ Object

See Also:

  • Object#==


56
57
58
# File 'lib/aixm/feature.rb', line 56

def ==(other)
  self.__class__ === other && self.to_uid.to_s == other.to_uid.to_s
end

#hashObject

See Also:

  • Object#eql?


61
62
63
# File 'lib/aixm/feature.rb', line 61

def hash
  [self.__class__, to_uid.to_s].hash
end