Class: Jekyll::Archimate::Folder
- Inherits:
-
Object
- Object
- Jekyll::Archimate::Folder
- Defined in:
- lib/jekyll/archimate/folder.rb
Overview
Represents an ArchiMate Organizing Folder
Instance Attribute Summary collapse
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
Instance Method Summary collapse
-
#initialize(folder) ⇒ Folder
constructor
A new instance of Folder.
-
#items ⇒ Object
This item check is necessary because some models seem to contain an item that is a string rather than an element of some sort.
- #to_h ⇒ Object
Constructor Details
#initialize(folder) ⇒ Folder
Returns a new instance of Folder.
9 10 11 |
# File 'lib/jekyll/archimate/folder.rb', line 9 def initialize(folder) @folder = folder end |
Instance Attribute Details
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
7 8 9 |
# File 'lib/jekyll/archimate/folder.rb', line 7 def folder @folder end |
Instance Method Details
#items ⇒ Object
This item check is necessary because some models seem to contain an item that is a string rather than an element of some sort.
15 16 17 |
# File 'lib/jekyll/archimate/folder.rb', line 15 def items folder.items.map { |item| item.is_a?(String) ? item : item.id } end |
#to_h ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/jekyll/archimate/folder.rb', line 19 def to_h Archimate.hash_purge( id: folder.id, name: folder.name.to_s, folders: folder.organizations.map { |child| Folder.new(child).to_h }, diagrams: items ) end |