Class: AIXM::Component::Address

Inherits:
AIXM::Component show all
Includes:
AIXM::Concerns::Association, AIXM::Concerns::Remarks
Defined in:
lib/aixm/component/address.rb

Overview

Address or similar means to contact an entity.

Cheat Sheet in Pseudo Code:

address = AIXM.address(
  type: TYPES
  address: AIXM.f (type :radio_frequency) or String (other types)
)
address.remarks = String or nil

Constant Summary collapse

TYPES =
{
  POST: :postal_address,
  PHONE: :phone,
  'PHONE-MET': :weather_phone,
  FAX: :fax,
  TLX: :telex,
  SITA: :sita,
  AFS: :aeronautical_fixed_service_address,
  EMAIL: :email,
  URL: :url,
  'URL-CAM': :webcam,
  'URL-MET': :weather_url,
  RADIO: :radio_frequency,
  OTHER: :other   # specify in remarks
}.freeze

Instance Attribute Summary collapse

Attributes included from AIXM::Concerns::Remarks

#remarks

Attributes inherited from AIXM::Component

#meta

Instance Method Summary collapse

Methods included from AIXM::Concerns::Association

included

Methods included from AIXM::Concerns::HashEquality

#eql?, #hash

Methods included from AIXM::Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from AIXM::Concerns::Memoize

included, method

Constructor Details

#initialize(type:, address:) ⇒ Address

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



60
61
62
# File 'lib/aixm/component/address.rb', line 60

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

Instance Attribute Details

#addressString #address=(value) ⇒ Object

Postal address, phone number, radio frequency etc

Overloads:

  • #addressString

    Returns:

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

    Parameters:

    • value (String)


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

def address
  @address
end

#typeSymbol #type=(value) ⇒ Object

Type of address

Overloads:

  • #typeSymbol

    Returns any of TYPES.

    Returns:

    • (Symbol)

      any of TYPES

  • #type=(value) ⇒ Object

    Parameters:

    • value (Symbol)

      any of TYPES



48
49
50
# File 'lib/aixm/component/address.rb', line 48

def type
  @type
end

Instance Method Details

#addressableAIXM::Feature

Returns addressable feature.

Returns:



40
# File 'lib/aixm/component/address.rb', line 40

belongs_to :addressable

#inspectString

Returns:

  • (String)


65
66
67
# File 'lib/aixm/component/address.rb', line 65

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