Class: AIXM::Feature::Organisation

Inherits:
AIXM::Feature show all
Includes:
Concerns::Association, Concerns::Remarks
Defined in:
lib/aixm/feature/organisation.rb

Overview

Organisations and authorities such as ATS organisations, aircraft operating agencies, states and so forth.

Cheat Sheet in Pseudo Code:

organisation = AIXM.organisation(
  source: String or nil
  region: String or nil
  name: String
  type: TYPES
)
organisation.id = String or nil
organisation.remarks = String or nil
organisation.comment = Object or nil

Constant Summary collapse

TYPES =
{
  S: :state,
  GS: :group_of_states,
  O: :national_organisation,
  IO: :international_organisation,
  AOA: :aircraft_operating_agency,
  ATS: :air_traffic_services_provider,
  HA: :handling_authority,
  A: :national_authority,
  OTHER: :other                          # specify in remarks
}.freeze

Constants inherited from AIXM::Feature

REGION_RE

Instance Attribute Summary collapse

Attributes included from Concerns::Remarks

#remarks

Attributes inherited from AIXM::Feature

#comment, #region, #source

Attributes inherited from Component

#meta

Instance Method Summary collapse

Methods included from Concerns::Association

included

Methods inherited from AIXM::Feature

#==, #hash

Methods included from Concerns::HashEquality

#eql?, #hash

Methods included from Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from Concerns::Memoize

included, method

Constructor Details

#initialize(source: nil, region: nil, name:, type:) ⇒ Organisation

See the cheat sheet for examples on how to create instances of this class.


75
76
77
78
# File 'lib/aixm/feature/organisation.rb', line 75

def initialize(source: nil, region: nil, name:, type:)
  super(source: source, region: region)
  self.name, self.type = name, type
end

Instance Attribute Details

#idString? #id=(value) ⇒ Object

Code of the organisation (e.g. “LF”)

Overloads:

  • #idString?

    Returns:

    • (String, nil)
  • #id=(value) ⇒ Object

    Parameters:

    • value (String, nil)

71
72
73
# File 'lib/aixm/feature/organisation.rb', line 71

def id
  @id
end

#nameString #name=(value) ⇒ Object

Name of organisation (e.g. “FRANCE”)

Overloads:

  • #nameString

    Returns:

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

    Parameters:

    • value (String)

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

def name
  @name
end

#typeSymbol #type=(value) ⇒ Object

Type of organisation

Overloads:

  • #typeSymbol

    Returns any of TYPES.

    Returns:

    • (Symbol)

      any of TYPES

  • #type=(value) ⇒ Object

    Parameters:

    • value (Symbol)

      any of TYPES


63
64
65
# File 'lib/aixm/feature/organisation.rb', line 63

def type
  @type
end

Instance Method Details

#add_member(member) ⇒ self


47
# File 'lib/aixm/feature/organisation.rb', line 47

has_many :members, accept: [:airport, :unit, 'AIXM::Feature::NavigationalAid']

#inspectString

Returns:

  • (String)

81
82
83
# File 'lib/aixm/feature/organisation.rb', line 81

def inspect
  %Q(#<#{self.class} name=#{name.inspect} type=#{type.inspect}>)
end

#membersArray<AIXM::Feature::Airport, AIXM::Feature::Unit, AIXM::Feature::NavigationalAid>

Returns aiports, units or navigational aids.

Returns:


47
# File 'lib/aixm/feature/organisation.rb', line 47

has_many :members, accept: [:airport, :unit, 'AIXM::Feature::NavigationalAid']