Class: Jekyll::Archimate::Folder
- Inherits:
-
Object
- Object
- Jekyll::Archimate::Folder
- Defined in:
- lib/jekyll/archimate/archimate_hook.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.
88 89 90 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 88 def initialize(folder) @folder = folder end |
Instance Attribute Details
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
86 87 88 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 86 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.
94 95 96 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 94 def items folder.items.map { |item| item.is_a?(String) ? item : item.id } end |
#to_h ⇒ Object
98 99 100 101 102 103 104 105 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 98 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 |