aixm 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +14 -0
  4. data/README.md +3 -1
  5. data/lib/aixm/a.rb +29 -15
  6. data/lib/aixm/association.rb +2 -1
  7. data/lib/aixm/classes.rb +4 -0
  8. data/lib/aixm/component/address.rb +15 -9
  9. data/lib/aixm/component/approach_lighting.rb +28 -25
  10. data/lib/aixm/component/fato.rb +38 -26
  11. data/lib/aixm/component/frequency.rb +32 -20
  12. data/lib/aixm/component/geometry/arc.rb +16 -3
  13. data/lib/aixm/component/geometry/border.rb +8 -1
  14. data/lib/aixm/component/geometry/circle.rb +14 -2
  15. data/lib/aixm/component/geometry/point.rb +8 -1
  16. data/lib/aixm/component/geometry/rhumb_line.rb +8 -1
  17. data/lib/aixm/component/geometry.rb +20 -10
  18. data/lib/aixm/component/helipad.rb +41 -20
  19. data/lib/aixm/component/layer.rb +31 -20
  20. data/lib/aixm/component/lighting.rb +22 -24
  21. data/lib/aixm/component/runway.rb +32 -25
  22. data/lib/aixm/component/service.rb +11 -17
  23. data/lib/aixm/component/surface.rb +47 -14
  24. data/lib/aixm/component/timesheet.rb +178 -0
  25. data/lib/aixm/component/timetable.rb +32 -13
  26. data/lib/aixm/component/vasis.rb +36 -6
  27. data/lib/aixm/component/vertical_limit.rb +26 -4
  28. data/lib/aixm/component.rb +4 -1
  29. data/lib/aixm/concerns/hash_equality.rb +21 -0
  30. data/lib/aixm/concerns/intensity.rb +30 -0
  31. data/lib/aixm/concerns/marking.rb +21 -0
  32. data/lib/aixm/concerns/remarks.rb +21 -0
  33. data/lib/aixm/concerns/timetable.rb +22 -0
  34. data/lib/aixm/d.rb +20 -14
  35. data/lib/aixm/document.rb +22 -5
  36. data/lib/aixm/f.rb +29 -17
  37. data/lib/aixm/feature/airport.rb +91 -45
  38. data/lib/aixm/feature/airspace.rb +28 -5
  39. data/lib/aixm/feature/navigational_aid/designated_point.rb +8 -1
  40. data/lib/aixm/feature/navigational_aid/dme.rb +12 -2
  41. data/lib/aixm/feature/navigational_aid/marker.rb +9 -2
  42. data/lib/aixm/feature/navigational_aid/ndb.rb +15 -3
  43. data/lib/aixm/feature/navigational_aid/vor.rb +20 -3
  44. data/lib/aixm/feature/navigational_aid.rb +29 -20
  45. data/lib/aixm/feature/obstacle.rb +105 -29
  46. data/lib/aixm/feature/obstacle_group.rb +3 -7
  47. data/lib/aixm/feature/organisation.rb +23 -14
  48. data/lib/aixm/feature/unit.rb +23 -11
  49. data/lib/aixm/feature.rb +23 -4
  50. data/lib/aixm/memoize.rb +3 -3
  51. data/lib/aixm/p.rb +20 -14
  52. data/lib/aixm/payload_hash.rb +5 -2
  53. data/lib/aixm/r.rb +15 -12
  54. data/lib/aixm/refinements.rb +42 -2
  55. data/lib/aixm/schedule/date.rb +181 -0
  56. data/lib/aixm/schedule/day.rb +114 -0
  57. data/lib/aixm/schedule/time.rb +255 -0
  58. data/lib/aixm/shortcuts.rb +3 -0
  59. data/lib/aixm/version.rb +1 -1
  60. data/lib/aixm/w.rb +20 -13
  61. data/lib/aixm/xy.rb +36 -25
  62. data/lib/aixm/z.rb +29 -17
  63. data/lib/aixm.rb +13 -0
  64. data.tar.gz.sig +0 -0
  65. metadata +22 -13
  66. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33661b6ab9022c54a9d41dad531b0f1c53f39eaf053a6c4b8361c50543b9ae01
4
- data.tar.gz: add22919257222a6f06dae9de21f0f71c2b941a67e6bc52dba14bde5fbae6c9a
3
+ metadata.gz: a1dc4f9cb88ab4e481f835ca4d309142c6a17910b396f4293a6d9e7d3f946ec6
4
+ data.tar.gz: 244adc808983bc3e810fb5847051a89dbd0893df3d2c709943d2c7231acfb434
5
5
  SHA512:
6
- metadata.gz: c1fb317e1791098f127c769e5f680bbf0c30ab823c73c48f392d6ea918f1ba4c6396d4e5cb43357ef1c867bad73e475d25be95b274bad7fd9ee17ce297dbbb6f
7
- data.tar.gz: 904a2fa5c84b80bf14a67536fa2c0f2ab26b6d34dc3dc789e272116812994f86b9c3aff92b08d1cda9b3d3495abfe990eb922f0579fd779a1602963ba28ded59
6
+ metadata.gz: ac00f735cca36dc6b1b0ec00c671dcbcbdb1e14c0d051fc8d865737e9ac1363d5648f5df69098b0daf721688c541a79188cac3603a07e01f8719fde3c8070d91
7
+ data.tar.gz: 59d6ffb78fcb04104838bc4fb0ba50e7f3c5d526e921410e4300d08dafa08a2aa9cd1d637d374d7e5428d05c56e5f66186377a2f32fb6bff6c14ce5539044884
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## Main
2
+
3
+ Nothing so far
4
+
5
+ ## 1.2.0
6
+
7
+ #### Additions
8
+ * `Timesheet` to add custom schedules to `Timetable`
9
+ * `AIXM::Schedule::(Date|Day|Time)` for custom timetables
10
+ * Interface to allow most class instances as Hash keys
11
+
12
+ #### Fixes
13
+ * Fix typo in `GUESSED_UNIT_TYPES_MAP`
14
+
1
15
  ## 1.1.0
2
16
 
3
17
  #### Breaking Changes
data/README.md CHANGED
@@ -11,7 +11,7 @@ For now, only the parts needed to automize the AIP import of [open flightmaps](h
11
11
 
12
12
  * [Homepage](https://github.com/svoop/aixm)
13
13
  * [API](https://www.rubydoc.info/gems/aixm)
14
- * Author: [Sven Schwyn - Bitcetera](http://www.bitcetera.com)
14
+ * Author: [Sven Schwyn - Bitcetera](https://bitcetera.com)
15
15
 
16
16
  ## Install
17
17
 
@@ -182,6 +182,7 @@ AIXM.config.ignored_errors = /invalid date/i
182
182
  * [Service](https://www.rubydoc.info/gems/aixm/AIXM/Component/Service.html)
183
183
  * [Surface](https://www.rubydoc.info/gems/aixm/AIXM/Component/Surface.html)
184
184
  * [Timetable](https://www.rubydoc.info/gems/aixm/AIXM/Component/Timetable.html)
185
+ * [Timesheet](https://www.rubydoc.info/gems/aixm/AIXM/Component/Timesheet.html)
185
186
  * [VASIS](https://www.rubydoc.info/gems/aixm/AIXM/Component/VASIS.html)
186
187
  * [Vertical limit](https://www.rubydoc.info/gems/aixm/AIXM/Component/VerticalLimit.html)
187
188
 
@@ -274,6 +275,7 @@ ckmid --help
274
275
  ### AIXM
275
276
  * [AIXM](http://aixm.aero)
276
277
  * [AICM 4.5 documentation](https://openflightmaps.gitlab.io/ofmx/aixm/4.5/manual/aicm/)
278
+ * [AICM 4.5 manual](https://www.aixm.aero/sites/aixm.aero/files/imce/library/aicm_manual_4-5.pdf)
277
279
  * [AIXM 4.5 specification](http://aixm.aero/document/aixm-45-specification)
278
280
 
279
281
  ### OFMX
data/lib/aixm/a.rb CHANGED
@@ -24,6 +24,8 @@ module AIXM
24
24
  # a.invert # => #<AIXM::A -137.8° "22R">
25
25
  # a.to_s(:runway) # => "22R"
26
26
  class A
27
+ include AIXM::Concerns::HashEquality
28
+
27
29
  SUFFIX_INVERSIONS = {
28
30
  R: :L,
29
31
  L: :R
@@ -31,12 +33,23 @@ module AIXM
31
33
 
32
34
  RUNWAY_RE = /\A(0[1-9]|[12]\d|3[0-6])([A-Z])?\z/
33
35
 
34
- # @return [Integer] angle in the range of -360 < angle < 360
36
+ # Angle in the range of -360 < angle < 360.
37
+ #
38
+ # @overload deg
39
+ # @return [Integer]
40
+ # @overload deg=(value)
41
+ # @param value [Integer]
35
42
  attr_reader :deg
36
43
 
37
- # @return [Symbol, nil] one-letter suffix
44
+ # One-letter suffix.
45
+ #
46
+ # @overload suffix
47
+ # @return [Symbol, nil]
48
+ # @overload suffix=(value)
49
+ # @param value [Symbol, nil]
38
50
  attr_reader :suffix
39
51
 
52
+ # See the {overview}[AIXM::A] for examples.
40
53
  def initialize(value)
41
54
  case value
42
55
  when String
@@ -54,12 +67,16 @@ module AIXM
54
67
  %Q(#<#{self.class} #{to_s} #{to_s(:runway).inspect}>)
55
68
  end
56
69
 
57
- # @return [Integer] within 0..359
70
+ # Degrees in the range of 0..359
71
+ #
72
+ # @return [Integer]
58
73
  def to_i
59
74
  (deg.round + 360) % 360
60
75
  end
61
76
 
62
- # @return [Float] within 0.0..359.9~
77
+ # Degrees in the range of 0.0...360.0
78
+ #
79
+ # @return [Float]
63
80
  def to_f
64
81
  ((deg + 360) % 360).to_f
65
82
  end
@@ -96,20 +113,20 @@ module AIXM
96
113
  @suffix = value&.to_s&.to_sym
97
114
  end
98
115
 
99
- # Invert an angle by 180 degrees
116
+ # Invert an angle by 180 degrees.
100
117
  #
101
118
  # @example
102
119
  # AIXM.a(120).invert # (300°)
103
120
  # AIXM.a("34L").invert # (160° suffix "R")
104
121
  #
105
- # @return [AIXM::A] inverted angle
122
+ # @return [AIXM::A]
106
123
  def invert
107
124
  self.class.new(deg.negative? ? deg - 180 : deg + 180).tap do |angle|
108
125
  angle.suffix = SUFFIX_INVERSIONS.fetch(suffix, suffix)
109
126
  end
110
127
  end
111
128
 
112
- # Check whether +other+ angle is the inverse
129
+ # Whether other angle is the inverse.
113
130
  #
114
131
  # @example
115
132
  # AIXM.a(120).inverse_of? AIXM.a(300) # => true
@@ -117,19 +134,19 @@ module AIXM
117
134
  # AIXM.a("33X").inverse_of? AIXM.a("33X") # => true
118
135
  # AIXM.a("16R").inverse_of? AIXM.a("16L") # => false
119
136
  #
120
- # @return [Boolean] whether the inverted angle or not
137
+ # @return [Boolean]
121
138
  def inverse_of?(other)
122
139
  invert == other
123
140
  end
124
141
 
125
- # Negate degrees
142
+ # Negate degrees.
126
143
  #
127
144
  # @return [AIXM::A]
128
145
  def -@
129
146
  deg.zero? ? self : self.class.new(-deg).tap { _1.suffix = suffix }
130
147
  end
131
148
 
132
- # Add degrees
149
+ # Add degrees.
133
150
  #
134
151
  # @param value [Numeric, AIXM::A]
135
152
  # @return [AIXM::A]
@@ -144,7 +161,7 @@ module AIXM
144
161
  end
145
162
  end
146
163
 
147
- # Subtract degrees
164
+ # Subtract degrees.
148
165
  #
149
166
  # @param value [Numeric, AIXM::A]
150
167
  # @return [AIXM::A]
@@ -153,16 +170,13 @@ module AIXM
153
170
  end
154
171
 
155
172
  # @see Object#==
156
- # @return [Boolean]
157
173
  def ==(other)
158
174
  self.class === other && deg == other.deg && suffix == other.suffix
159
175
  end
160
- alias_method :eql?, :==
161
176
 
162
177
  # @see Object#hash
163
- # @return [Integer]
164
178
  def hash
165
- [deg, suffix].join.hash
179
+ [self.class, deg, suffix].join.hash
166
180
  end
167
181
  end
168
182
 
@@ -179,7 +179,7 @@ module AIXM
179
179
  (@has_many_attributes ||= []) << attribute
180
180
  # features
181
181
  define_method(attribute) do
182
- instance_eval("@#{attribute} ||= AIXM::Association::Array.new")
182
+ instance_variable_get(:"@#{attribute}") || AIXM::Association::Array.new
183
183
  end
184
184
  # add_feature
185
185
  define_method(:"add_#{association}") do |object=nil, **options, &add_block|
@@ -190,6 +190,7 @@ module AIXM
190
190
  end
191
191
  instance_exec(object, **options, &association_block) if association_block
192
192
  fail(ArgumentError, "#{object.__class__} not allowed") unless class_names.any? { |c| object.is_a?(c.to_class) }
193
+ instance_eval("@#{attribute} ||= AIXM::Association::Array.new")
193
194
  send(attribute).send(:push, object)
194
195
  object.instance_variable_set(:"@#{inversion}", self)
195
196
  self
data/lib/aixm/classes.rb CHANGED
@@ -11,6 +11,9 @@ module AIXM
11
11
  a: 'AIXM::A',
12
12
  w: 'AIXM::W',
13
13
  p: 'AIXM::P',
14
+ date: 'AIXM::Schedule::Date',
15
+ day: 'AIXM::Schedule::Day',
16
+ time: 'AIXM::Schedule::Time',
14
17
  address: 'AIXM::Component::Address',
15
18
  approach_lighting: 'AIXM::Component::ApproachLighting',
16
19
  organisation: 'AIXM::Feature::Organisation',
@@ -41,6 +44,7 @@ module AIXM
41
44
  obstacle: 'AIXM::Feature::Obstacle',
42
45
  obstacle_group: 'AIXM::Feature::ObstacleGroup',
43
46
  timetable: 'AIXM::Component::Timetable',
47
+ timesheet: 'AIXM::Component::Timesheet',
44
48
  vasis: 'AIXM::Component::VASIS'
45
49
  }.freeze
46
50
 
@@ -16,6 +16,7 @@ module AIXM
16
16
  class Address < Component
17
17
  include AIXM::Association
18
18
  include AIXM::Memoize
19
+ include AIXM::Concerns::Remarks
19
20
 
20
21
  public_class_method :new
21
22
 
@@ -39,15 +40,24 @@ module AIXM
39
40
  # @return [AIXM::Feature] addressable feature
40
41
  belongs_to :addressable
41
42
 
42
- # @return [Symbol] type of address (see {TYPES})
43
+ # Type of address
44
+ #
45
+ # @overload type
46
+ # @return [Symbol] any of {TYPES}
47
+ # @overload type=(value)
48
+ # @param value [Symbol] any of {TYPES}
43
49
  attr_reader :type
44
50
 
45
- # @return [String] postal address, phone number, radio frequency etc
51
+ # Postal address, phone number, radio frequency etc
52
+ #
53
+ # @overload address
54
+ # @return [String]
55
+ # @overload address=(value)
56
+ # @param value [String]
46
57
  attr_reader :address
47
58
 
48
- # @return [String, nil] free text remarks
49
- attr_reader :remarks
50
-
59
+ # See the {cheat sheet}[AIXM::Component::Address] for examples on how to
60
+ # create instances of this class.
51
61
  def initialize(type:, address:)
52
62
  self.type, self.address = type, address
53
63
  end
@@ -72,10 +82,6 @@ module AIXM
72
82
  end
73
83
  end
74
84
 
75
- def remarks=(value)
76
- @remarks = value&.to_s
77
- end
78
-
79
85
  # @return [String] UID markup
80
86
  def to_uid(as:, sequence:)
81
87
  builder = Builder::XmlMarkup.new(indent: 2)
@@ -19,6 +19,8 @@ module AIXM
19
19
  class ApproachLighting < Component
20
20
  include AIXM::Association
21
21
  include AIXM::Memoize
22
+ include AIXM::Concerns::Intensity
23
+ include AIXM::Concerns::Remarks
22
24
 
23
25
  TYPES = {
24
26
  A: :cat_1,
@@ -41,35 +43,44 @@ module AIXM
41
43
  OTHER: :other # specify in remarks
42
44
  }.freeze
43
45
 
44
- INTENSITIES = {
45
- LIL: :low,
46
- LIM: :medium,
47
- LIH: :high,
48
- OTHER: :other # specify in remarks
49
- }.freeze
50
-
51
46
  # @!method approach_lightable
52
47
  # @return [AIXM::Component::Runway::Direction, AIXM::Component::FATO::Direction] approach lighted entity
53
48
  belongs_to :approach_lightable
54
49
 
55
- # @return [Symbol, nil] type of the approach lighting system (see {TYPES})
50
+ # Type of the approach lighting system
51
+ #
52
+ # @overload type
53
+ # @return [Symbol] any of {TYPES}
54
+ # @overload type=(value)
55
+ # @param value [Symbol] any of {TYPES}
56
56
  attr_reader :type
57
57
 
58
- # @return [AIXM::D, nil] length
58
+ # Length
59
+ #
60
+ # @overload length
61
+ # @return [AIXM::D, nil]
62
+ # @overload length=(value)
63
+ # @param value [AIXM::D, nil]
59
64
  attr_reader :length
60
65
 
61
- # @return [Symbol, nil] intensity of lights (see {INTENSITIES})
62
- attr_reader :intensity
63
-
64
- # @return [Boolean, nil] whether sequenced flash is available
66
+ # Whether sequenced flash is available
67
+ #
68
+ # @overload sequenced_flash
69
+ # @return [Boolean, nil] +nil+ means unknown
70
+ # @overload sequenced_flash=(value)
71
+ # @param value [Boolean, nil] +nil+ means unknown
65
72
  attr_reader :sequenced_flash
66
73
 
67
- # @return [String, nil] description of the flash sequence
74
+ # Description of the flash sequence
75
+ #
76
+ # @overload flash_description
77
+ # @return [String, nil]
78
+ # @overload flash_description=(value)
79
+ # @param value [String, nil]
68
80
  attr_reader :flash_description
69
81
 
70
- # @return [String, nil] free text remarks
71
- attr_reader :remarks
72
-
82
+ # See the {cheat sheet}[AIXM::Component::ApproachLighting] for examples on
83
+ # how to create instances of this class.
73
84
  def initialize(type:)
74
85
  self.type = type
75
86
  end
@@ -88,10 +99,6 @@ module AIXM
88
99
  @length = value
89
100
  end
90
101
 
91
- def intensity=(value)
92
- @intensity = value.nil? ? nil : INTENSITIES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid intensity")
93
- end
94
-
95
102
  def sequenced_flash=(value)
96
103
  fail(ArgumentError, "invalid sequenced flash") unless [true, false, nil].include? value
97
104
  @sequenced_flash = value
@@ -101,10 +108,6 @@ module AIXM
101
108
  @flash_description = value&.to_s
102
109
  end
103
110
 
104
- def remarks=(value)
105
- @remarks = value&.to_s
106
- end
107
-
108
111
  # @return [String] UID markup
109
112
  def to_uid(as:)
110
113
  builder = Builder::XmlMarkup.new(indent: 2)
@@ -30,6 +30,8 @@ module AIXM
30
30
  class FATO < Component
31
31
  include AIXM::Association
32
32
  include AIXM::Memoize
33
+ include AIXM::Concerns::Marking
34
+ include AIXM::Concerns::Remarks
33
35
 
34
36
  STATUSES = {
35
37
  CLSD: :closed,
@@ -63,24 +65,41 @@ module AIXM
63
65
  # @return [AIXM::Component::Helipad] helipad situated on this FATO
64
66
  belongs_to :helipad
65
67
 
66
- # @return [String] full name (e.g. "H1")
68
+ # Full name (e.g. "H1")
69
+ #
70
+ # @overload name
71
+ # @return [String]
72
+ # @overload name=(value)
73
+ # @param value [String]
67
74
  attr_reader :name
68
75
 
69
- # @return [AIXM::R, nil] dimensions
76
+ # Dimensions
77
+ #
78
+ # @overload dimensions
79
+ # @return [AIXM::R, nil]
80
+ # @overload dimensions=(value)
81
+ # @param value [AIXM::R, nil]
70
82
  attr_reader :dimensions
71
83
 
72
- # @return [String, nil] markings
73
- attr_reader :marking
74
-
75
- # @return [String, nil] profile description
84
+ # Profile description
85
+ #
86
+ # @overload profile
87
+ # @return [String, nil]
88
+ # @overload profile=(value)
89
+ # @param value [String, nil]
76
90
  attr_reader :profile
77
91
 
78
- # @return [Symbol, nil] status of the FATO (see {STATUSES}) or +nil+ for normal operation
92
+ # Status of the FATO
93
+ #
94
+ # @overload status
95
+ # @return [Symbol, nil] any of {STATUSES} or +nil+ for normal operation
96
+ # @overload status=(value)
97
+ # @param value [Symbol, nil] any of {STATUSES} or +nil+ for normal
98
+ # operation
79
99
  attr_reader :status
80
100
 
81
- # @return [String, nil] free text remarks
82
- attr_reader :remarks
83
-
101
+ # See the {cheat sheet}[AIXM::Component::FATO] for examples on how to
102
+ # create instances of this class.
84
103
  def initialize(name:)
85
104
  self.name = name
86
105
  self.surface = AIXM.surface
@@ -101,10 +120,6 @@ module AIXM
101
120
  @dimensions = value
102
121
  end
103
122
 
104
- def marking=(value)
105
- @marking = value&.to_s
106
- end
107
-
108
123
  def profile=(value)
109
124
  @profile = value&.to_s
110
125
  end
@@ -113,10 +128,6 @@ module AIXM
113
128
  @status = value.nil? ? nil : (STATUSES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid status"))
114
129
  end
115
130
 
116
- def remarks=(value)
117
- @remarks = value&.to_s
118
- end
119
-
120
131
  # @return [String] UID markup
121
132
  def to_uid
122
133
  builder = Builder::XmlMarkup.new(indent: 2)
@@ -157,6 +168,7 @@ module AIXM
157
168
  class Direction
158
169
  include AIXM::Association
159
170
  include AIXM::Memoize
171
+ include AIXM::Concerns::Remarks
160
172
 
161
173
  # @!method lightings
162
174
  # @return [Array<AIXM::Component::Lighting>] installed lighting systems
@@ -177,7 +189,12 @@ module AIXM
177
189
  # @return [AIXM::Component::FATO] FATO the FATO direction is further describing
178
190
  belongs_to :fato
179
191
 
180
- # @return [AIXM::A] name of the FATO direction (e.g. "12" or "16L")
192
+ # Name of the FATO direction (e.g. "12" or "16L")
193
+ #
194
+ # @overload name
195
+ # @return [AIXM::A]
196
+ # @overload name=(value)
197
+ # @param value [AIXM::A]
181
198
  attr_reader :name
182
199
 
183
200
  # @return [AIXM::A, nil] (true) geographic bearing in degrees
@@ -187,9 +204,8 @@ module AIXM
187
204
  # system
188
205
  attr_reader :vasis
189
206
 
190
- # @return [String, nil] free text remarks
191
- attr_reader :remarks
192
-
207
+ # See the {cheat sheet}[AIXM::Component::FATO] for examples on how to
208
+ # create instances of this class.
193
209
  def initialize(name:)
194
210
  self.name = name
195
211
  self.vasis = AIXM.vasis
@@ -211,10 +227,6 @@ module AIXM
211
227
  @geographic_bearing = value
212
228
  end
213
229
 
214
- def remarks=(value)
215
- @remarks = value&.to_s
216
- end
217
-
218
230
  # @return [AIXM::A] magnetic bearing in degrees
219
231
  def magnetic_bearing
220
232
  if geographic_bearing && fato.airport.declination
@@ -24,6 +24,8 @@ module AIXM
24
24
  class Frequency < Component
25
25
  include AIXM::Association
26
26
  include AIXM::Memoize
27
+ include AIXM::Concerns::Timetable
28
+ include AIXM::Concerns::Remarks
27
29
 
28
30
  TYPES = {
29
31
  STD: :standard,
@@ -39,29 +41,48 @@ module AIXM
39
41
  # @return [AIXM::Component::Service] service the frequency belongs to
40
42
  belongs_to :service
41
43
 
42
- # @return [AIXM::F] frequency for transmission (outgoing)
44
+ # Frequency for transmission (outgoing)
45
+ #
46
+ # @overload transmission_f
47
+ # @return [AIXM::F]
48
+ # @overload transmission_f=(value)
49
+ # @param value [AIXM::F]
43
50
  attr_reader :transmission_f
44
51
 
52
+
53
+ # Map from languages (ISO 639-1) to callsigns
54
+ #
45
55
  # @example
46
56
  # { en: "STRASBOURG CONTROL", fr: "STRASBOURG CONTROLE" }
47
57
  #
48
- # @return [Hash] map from languages (ISO 639-1) to callsigns
58
+ # @overload callsigns
59
+ # @return [Hash]
60
+ # @overload callsigns=(value)
61
+ # @param value [Hash]
49
62
  attr_reader :callsigns
50
63
 
64
+
65
+ # Frequency for reception (incoming)
66
+ #
51
67
  # @note One-way services such as ATIS should set this to +nil+ and simplex
52
- # (aka: non-duplex) communication should set this to {#transmission_f}.
53
- # @return [AIXM::F, nil] frequency for reception (incoming)
68
+ # (aka: non-duplex) communication should set this to {#transmission_f}.
69
+ #
70
+ # @overload reception_f
71
+ # @return [AIXM::F, nil]
72
+ # @overload reception_f=(value)
73
+ # @param value [AIXM::F, nil]
54
74
  attr_reader :reception_f
55
75
 
56
- # @return [Symbol, nil] type of frequency (see {TYPES})
76
+ # Type of frequency
77
+ #
78
+ # @overload type
79
+ # @return [Symbol, nil] any of {TYPES}
80
+ # @overload type=(value)
81
+ # @param value [Symbol, nil] any of {TYPES}
57
82
  attr_reader :type
58
83
 
59
- # @return [AIXM::Component::Timetable, nil] operating hours
60
- attr_reader :timetable
61
-
62
- # @return [String, nil] free text remarks
63
- attr_reader :remarks
64
-
84
+ # See the {cheat sheet}[AIXM::Component::Frequency] for examples on how to
85
+ # create instances of this class.
65
86
  def initialize(transmission_f:, callsigns:)
66
87
  self.transmission_f, self.callsigns = transmission_f, callsigns
67
88
  self.reception_f = transmission_f
@@ -91,15 +112,6 @@ module AIXM
91
112
  @type = value.nil? ? nil : TYPES.lookup(value.to_s.to_sym, nil) || fail(ArgumentError, "invalid type")
92
113
  end
93
114
 
94
- def timetable=(value)
95
- fail(ArgumentError, "invalid timetable") unless value.nil? || value.is_a?(AIXM::Component::Timetable)
96
- @timetable = value
97
- end
98
-
99
- def remarks=(value)
100
- @remarks = value&.to_s
101
- end
102
-
103
115
  # @return [String] UID markup
104
116
  def to_uid
105
117
  builder = Builder::XmlMarkup.new(indent: 2)
@@ -16,9 +16,17 @@ module AIXM
16
16
  #
17
17
  # @see https://gitlab.com/openflightmaps/ofmx/wikis/Airspace#arc
18
18
  class Arc < Point
19
- # @return [AIXM::XY] center point
19
+
20
+ # Center point
21
+ #
22
+ # @overload center_xy
23
+ # @return [AIXM::XY]
24
+ # @overload center_xy=(value)
25
+ # @param value [AIXM::XY]
20
26
  attr_reader :center_xy
21
27
 
28
+ # See the {cheat sheet}[AIXM::Component::Geometry::Arc] for examples on
29
+ # how to create instances of this class.
22
30
  def initialize(xy:, center_xy:, clockwise:)
23
31
  super(xy: xy)
24
32
  self.center_xy, self.clockwise = center_xy, clockwise
@@ -34,8 +42,13 @@ module AIXM
34
42
  @center_xy = value
35
43
  end
36
44
 
37
- # @!attribute [w] clockwise
38
- # @return [Boolean] wheter the arc is going clockwise (true) or not (false)
45
+ # Whether the arc is going clockwise
46
+ #
47
+ # @!attribute clockwise
48
+ # @overload clockwise?
49
+ # @return [Boolean] clockwise (true) or counterclockwise (false)
50
+ # @overload clockwise=(value)
51
+ # @param value [Boolean] clockwise (true) or counterclockwise (false)
39
52
  def clockwise?
40
53
  @clockwise
41
54
  end
@@ -17,9 +17,16 @@ module AIXM
17
17
  class Border < Point
18
18
  include AIXM::Memoize
19
19
 
20
- # @return [String] name of the border
20
+ # Name of the border
21
+ #
22
+ # @overload name
23
+ # @return [String]
24
+ # @overload name=(value)
25
+ # @param value [String]
21
26
  attr_reader :name
22
27
 
28
+ # See the {cheat sheet}[AIXM::Component::Geometry::Border] for examples
29
+ # on how to create instances of this class.
23
30
  def initialize(xy:, name:)
24
31
  super(xy: xy)
25
32
  self.name = name
@@ -20,12 +20,24 @@ module AIXM
20
20
  # @return [AIXM::Component::Geometry] geometry this segment belongs to
21
21
  belongs_to :geometry, as: :segment
22
22
 
23
- # @return [AIXM::XY] center point
23
+ # Center point
24
+ #
25
+ # @overload center_xy
26
+ # @return [AIXM::XY]
27
+ # @overload center_xy=(value)
28
+ # @param value [AIXM::XY]
24
29
  attr_reader :center_xy
25
30
 
26
- # @return [AIXM::D] circle radius
31
+ # Circle radius
32
+ #
33
+ # @overload radius
34
+ # @return [AIXM::D]
35
+ # @overload radius=(value)
36
+ # @param value [AIXM::D]
27
37
  attr_reader :radius
28
38
 
39
+ # See the {cheat sheet}[AIXM::Component::Geometry::Circle] for examples
40
+ # on how to create instances of this class.
29
41
  def initialize(center_xy:, radius:)
30
42
  self.center_xy, self.radius = center_xy, radius
31
43
  end
@@ -20,9 +20,16 @@ module AIXM
20
20
  # @return [AIXM::Component::Geometry] geometry this segment belongs to
21
21
  belongs_to :geometry, as: :segment
22
22
 
23
- # @return [AIXM::XY] (starting) point
23
+ # (Starting) point
24
+ #
25
+ # @overload xy
26
+ # @return [AIXM::XY]
27
+ # @overload xy=(value)
28
+ # @param value [AIXM::XY]
24
29
  attr_reader :xy
25
30
 
31
+ # See the {cheat sheet}[AIXM::Component::Geometry::Point] for examples
32
+ # on how to create instances of this class.
26
33
  def initialize(xy:)
27
34
  self.xy = xy
28
35
  end