Class: AIXM::Feature::Airport::UsageLimitation

Inherits:
Object
  • Object
show all
Includes:
Concerns::Association, Concerns::Remarks, Concerns::Timetable, Concerns::XMLBuilder
Defined in:
lib/aixm/feature/airport.rb

Overview

Limitations concerning the availability of an airport for certain flight types, aircraft types etc during specific hours.

See UsageLimitation::TYPES for recognized limitations and UsageLimitation#add_condition for recognized conditions.

Multiple conditions are joined with an implicit or whereas the specifics of a condition (aircraft, rule etc) are joined with an implicit and.

Examples:

Limitation applying to any traffic

airport.add_usage_limitation(type: :permitted)

Limitation applying to specific traffic

airport.add_usage_limitation(type: :reservation_required) do |reservation_required|
  reservation_required.add_condition do |condition|
    condition.aircraft = :glider
  end
  reservation_required.add_condition do |condition|
    condition.rule = :ifr
    condition.origin = :international
  end
  reservation_required.timetable = AIXM::H24
  reservation_required.remarks = "Reservation 24 HRS prior to arrival"
end

See Also:

Defined Under Namespace

Classes: Condition

Constant Summary collapse

TYPES =
{
  PERMIT: :permitted,
  FORBID: :forbidden,
  RESERV: :reservation_required,
  OTHER: :other                    # specify in remarks
}.freeze

Instance Attribute Summary collapse

Attributes included from Concerns::Remarks

#remarks

Attributes included from Concerns::Timetable

#timetable

Instance Method Summary collapse

Methods included from Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from Concerns::Memoize

included, method

Methods included from Concerns::Association

included

Constructor Details

#initialize(type:) ⇒ UsageLimitation

See the cheat sheet for

examples on how to create instances of this class.


410
411
412
# File 'lib/aixm/feature/airport.rb', line 410

def initialize(type:)
  self.type = type
end

Instance Attribute Details

#typeSymbol #type=(value) ⇒ Object

Type of limitation

Overloads:

  • #typeSymbol

    Returns any of TYPES.

    Returns:

    • (Symbol)

      any of TYPES

  • #type=(value) ⇒ Object

    Parameters:

    • value (Symbol)

      any of TYPES



406
407
408
# File 'lib/aixm/feature/airport.rb', line 406

def type
  @type
end

Instance Method Details

#add_condition {|AIXM::Feature::Airport::UsageLimitation::Condition| ... } ⇒ self



394
# File 'lib/aixm/feature/airport.rb', line 394

has_many :conditions, accept: 'AIXM::Feature::Airport::UsageLimitation::Condition' do |condition| end

#airportAIXM::Feature::Airport

Returns airport this usage limitation is assigned to.

Returns:



398
# File 'lib/aixm/feature/airport.rb', line 398

belongs_to :airport

#conditionsArray<AIXM::Feature::Airport::UsageLimitation::Condition>

Returns conditions for this limitation to apply.

Returns:



394
# File 'lib/aixm/feature/airport.rb', line 394

has_many :conditions, accept: 'AIXM::Feature::Airport::UsageLimitation::Condition' do |condition| end

#inspectString

Returns:

  • (String)


415
416
417
# File 'lib/aixm/feature/airport.rb', line 415

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