Class: AIXM::Feature::Unit
- Inherits:
-
AIXM::Feature
- Object
- Component
- AIXM::Feature
- AIXM::Feature::Unit
- Includes:
- Concerns::Association, Concerns::Remarks
- Defined in:
- lib/aixm/feature/unit.rb
Overview
Units providing all kind of services such as air traffic management, search and rescue, meteorological services and so forth.
Cheat Sheet in Pseudo Code:
unit = AIXM.unit(
source: String or nil
region: String or nil
organisation: AIXM.organisation
name: String
type: TYPES
class: :icao or :other
)
unit.airport = AIXM.airport or nil
unit.remarks = String or nil
unit.comment = Object or nil
unit.add_service(AIXM.service)
Constant Summary collapse
- TYPES =
{ ACC: :area_control_centre, ADSU: :automatic_dependent_surveillance_unit, ADVC: :advisory_centre, ALPS: :alerting_post, AOF: :aeronautical_information_services_office, APP: :approach_control_office, 'APP-ARR': :arrivals_approach_control_office, 'APP-DEP': :depatures_approach_control_office, ARO: :air_traffic_service_reporting_office, ARTCC: :air_route_traffic_control_centre, ATCC: :air_traffic_control_centre, ATFMU: :air_traffic_flow_management_unit, ATMU: :air_traffic_management_unit, ATSU: :air_traffic_services_unit, BOF: :briefing_office, BS: :commercial_broadcasting_station, COM: :communications_office, FCST: :forecasting_office, FIC: :flight_information_centre, FSS: :flight_service_station, GCA: :ground_controlled_approach_systems_office, MET: :meteorological_office, MIL: :military_station, MILOPS: :military_flight_operations_briefing_office, MWO: :meteorological_watch_office, NOF: :international_notam_office, OAC: :oceanic_control_centre, PAR: :precision_approach_radar_centre, RAD: :radar_office, RAFC: :regional_area_forecast_centre, RCC: :rescue_coordination_centre, RSC: :rescue_sub_centre, SAR: :search_and_rescue_centre, SMC: :surface_movement_control_office, SMR: :surface_movement_radar_office, SRA: :surveillance_radar_approach_centre, SSR: :secondary_surveillance_radar_centre, TAR: :terminal_area_surveillance_radar_centre, TRACON: :terminal_radar_approach_control, TWR: :aerodrome_control_tower, UAC: :upper_area_control_centre, UDF: :uhf_direction_finding_station, UIC: :upper_information_centre, VDF: :vdf_direction_finding_station, WAFC: :world_area_forecast_centre, OTHER: :other # specify in remarks }.freeze
- CLASSES =
{ ICAO: :icao, OTHER: :other # specify in remarks }.freeze
Constants inherited from AIXM::Feature
Instance Attribute Summary collapse
-
#class ⇒ Object
Class of unit.
-
#name ⇒ Object
Name of unit (e.g. “MARSEILLE ACS”).
-
#type ⇒ Object
Type of unit.
Attributes included from Concerns::Remarks
Attributes inherited from AIXM::Feature
Attributes inherited from Component
Instance Method Summary collapse
- #add_service(service) ⇒ Object
-
#airport ⇒ AIXM::Feature::Airport?
Airport.
-
#initialize(source: nil, region: nil, organisation:, name:, type:, class:) ⇒ Unit
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
-
#organisation ⇒ AIXM::Feature::Organisation
Superior organisation.
-
#services ⇒ Array<AIXM::Component::Service>
Services provided by this unit.
Methods included from Concerns::Association
Methods inherited from AIXM::Feature
Methods included from Concerns::HashEquality
Methods included from Concerns::XMLBuilder
#build_fragment, #to_uid, #to_xml
Methods included from Concerns::Memoize
Constructor Details
#initialize(source: nil, region: nil, organisation:, name:, type:, class:) ⇒ Unit
See the cheat sheet for examples on how to create instances of this class.
117 118 119 120 121 |
# File 'lib/aixm/feature/unit.rb', line 117 def initialize(source: nil, region: nil, organisation:, name:, type:, class:) super(source: source, region: region) self.organisation, self.name, self.type = organisation, name, type self.class = binding.local_variable_get(:class) end |
Instance Attribute Details
#class ⇒ Symbol #class=(value) ⇒ Object
Note:
Use Object#__class__ alias to query the Ruby object class.
Class of unit.
146 147 148 |
# File 'lib/aixm/feature/unit.rb', line 146 def class @klass end |
#name ⇒ String #name=(value) ⇒ Object
Name of unit (e.g. “MARSEILLE ACS”)
105 106 107 |
# File 'lib/aixm/feature/unit.rb', line 105 def name @name end |
#type ⇒ Symbol #type=(value) ⇒ Object
Type of unit
113 114 115 |
# File 'lib/aixm/feature/unit.rb', line 113 def type @type end |
Instance Method Details
#airport ⇒ AIXM::Feature::Airport?
Returns airport.
97 |
# File 'lib/aixm/feature/unit.rb', line 97 belongs_to :airport |
#inspect ⇒ String
124 125 126 |
# File 'lib/aixm/feature/unit.rb', line 124 def inspect %Q(#<#{__class__} name=#{name.inspect} type=#{type.inspect}>) end |
#organisation ⇒ AIXM::Feature::Organisation
Returns superior organisation.
93 |
# File 'lib/aixm/feature/unit.rb', line 93 belongs_to :organisation, as: :member |
#services ⇒ Array<AIXM::Component::Service>
Returns services provided by this unit.
89 |
# File 'lib/aixm/feature/unit.rb', line 89 has_many :services |