class AIXM::Component::Timetable

Timetables define activity time windows.

@note As of now, only predefined timetables (see {CODES}) are imlemented.

Cheat Sheat in Pseudo Code:

timetable = AIXM.timetable(
  code: String or Symbol
)
timetable.remarks = String or nil

Shortcuts:

@see gitlab.com/openflightmaps/ofmx/wikis/Timetable#predefined-timetable

Constants

CODES

Attributes

code[R]

@return [Symbol] predefined timetable code (see {CODES})

remarks[R]

@return [String, nil] free text remarks

Public Class Methods

new(code:) click to toggle source
   # File lib/aixm/component/timetable.rb
38 def initialize(code:)
39   self.code = code
40 end

Public Instance Methods

code=(value) click to toggle source
   # File lib/aixm/component/timetable.rb
47 def code=(value)
48   @code = CODES.lookup(value&.to_s&.to_sym, nil) || fail(ArgumentError, "invalid code")
49 end
inspect() click to toggle source

@return [String]

   # File lib/aixm/component/timetable.rb
43 def inspect
44   %Q(#<#{self.class} code=#{code.inspect}>)
45 end
remarks=(value) click to toggle source
   # File lib/aixm/component/timetable.rb
51 def remarks=(value)
52   @remarks = value&.to_s
53 end
to_xml(as: :Timetable) click to toggle source

@return [String] AIXM or OFMX markup

   # File lib/aixm/component/timetable.rb
56 def to_xml(as: :Timetable)
57   builder = Builder::XmlMarkup.new(indent: 2)
58   builder.tag!(as) do |tag|
59     tag.codeWorkHr(CODES.key(code).to_s)
60     tag.txtRmkWorkHr(remarks) if remarks
61   end
62 end