README.md in aixm-1.2.1 vs README.md in aixm-1.3.0
- old
+ new
@@ -26,11 +26,11 @@
### Bundler
Add the following to the <tt>Gemfile</tt> or <tt>gems.rb</tt> of your [Bundler](https://bundler.io) powered Ruby project:
```ruby
-gem aixm
+gem 'aixm'
```
And then install the bundle:
```
@@ -161,10 +161,11 @@
* [Obstacle](https://www.rubydoc.info/gems/aixm/AIXM/Feature/Obstacle.html)
* [Obstacle group](https://www.rubydoc.info/gems/aixm/AIXM/Feature/ObstacleGroup.html)
* [Organisation](https://www.rubydoc.info/gems/aixm/AIXM/Feature/Organisation.html)
* [Service](https://www.rubydoc.info/gems/aixm/AIXM/Component/Service.html)
* [Unit](https://www.rubydoc.info/gems/aixm/AIXM/Feature/Unit.html)
+* [Generic](https://www.rubydoc.info/gems/aixm/AIXM/Feature/Generic.html)
### Components
* [ApproachLighting](https://www.rubydoc.info/gems/aixm/AIXM/Component/ApproachLighting.html)
* [FATO](https://www.rubydoc.info/gems/aixm/AIXM/Component/FATO.html)
@@ -188,11 +189,11 @@
## Associations
The different models are interwoven with [`has_many` and `has_one` associations](https://www.rubydoc.info/gems/aixm/AIXM/Association).
-Please note that `has_many` associations are instances `AIXM::Association::Array` which mostly behave like normal arrays. However, you must not add or remove elements on the array directly but use the corresponding method on the associating model instead:
+Please note that `has_many` associations are instances `AIXM::Concerns::Association::Array` which mostly behave like normal arrays. However, you must not add or remove elements on the array directly but use the corresponding method on the associating model instead:
```ruby
document.features << airport # => NoMethodError
document.add_feature airport # okay
```
@@ -226,9 +227,36 @@
Equally on `has_many` associations, use `duplicates` to find identical or equal associations:
```ruby
document.features.duplicates # => [#<AIXM::Feature::Unit>, #<AIXM::Component::Service>, ...]
+```
+
+## XML Comments
+
+All features implement the `comment` attribute which accepts any object and converts it `#to_s`. When set, an XML comment is inserted right after the opening tag of the feature. This comes in handy e.g. in case you want to include source data facsimile such as NOTAM. Oneline and multiline comments are inserted differently:
+
+```xml
+<Ase>
+ <!--
+ B0330/22 NOTAMR B1756/21
+ Q) LSAS/QAFLT/V/NBO/E/000/050/4734N00841E005
+ A) LSAS B) 2203170746 C) 2206242359 EST
+ -->
+ <AseUid>
+ <codeType>RAS</codeType>
+ <codeId>B0330/22</codeId>
+ </AseUid>
+ (...)
+</Ase>
+
+<Org>
+ <!-- Generic organisation -->
+ <OrgUid>
+ <txtName>FRANCE</txtName>
+ </OrgUid>
+ (...)
+</Org>
```
## Payload Hash
OFMX defines a [payload hash function](https://gitlab.com/openflightmaps/ofmx/wikis/Functions) used to facilitate association and modification tracking. It is used internally, but you can also use it in your own code: