Class: Archimate::FileFormats::Serializer::NamedCollection
- Inherits:
-
Object
- Object
- Archimate::FileFormats::Serializer::NamedCollection
- Defined in:
- lib/archimate/file_formats/serializer/named_collection.rb
Instance Method Summary collapse
-
#initialize(name, collection) ⇒ NamedCollection
constructor
A new instance of NamedCollection.
- #serialize(xml, &block) ⇒ Object
Constructor Details
#initialize(name, collection) ⇒ NamedCollection
Returns a new instance of NamedCollection.
7 8 9 10 |
# File 'lib/archimate/file_formats/serializer/named_collection.rb', line 7 def initialize(name, collection) @name = name @collection = collection end |
Instance Method Details
#serialize(xml, &block) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/archimate/file_formats/serializer/named_collection.rb', line 12 def serialize(xml, &block) return unless @collection&.size&.positive? xml.send(@name) do block.call(xml, @collection) end end |