Class: Zm::Client::MountPointsBuilder
- Inherits:
-
Base::ObjectsBuilder
- Object
- Base::ObjectsBuilder
- Zm::Client::MountPointsBuilder
- Defined in:
- lib/zm/client/mountpoint/mountpoints_builder.rb
Overview
class factory [mountpoints]
Instance Method Summary collapse
- #construct_tree(json_folders) ⇒ Object
-
#initialize(parent, json) ⇒ MountPointsBuilder
constructor
A new instance of MountPointsBuilder.
- #make ⇒ Object
Methods inherited from Base::ObjectsBuilder
Constructor Details
#initialize(parent, json) ⇒ MountPointsBuilder
Returns a new instance of MountPointsBuilder.
7 8 9 10 11 12 |
# File 'lib/zm/client/mountpoint/mountpoints_builder.rb', line 7 def initialize(parent, json) super(parent, json) @key_link = :link @key_folder = :folder @list = [] end |
Instance Method Details
#construct_tree(json_folders) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/zm/client/mountpoint/mountpoints_builder.rb', line 22 def construct_tree(json_folders) json_folders.each do |json_folder| if json_folder[@key_link].is_a?(Array) @list += json_folder[@key_link].map do |json_link| MountpointJsnsInitializer.create(@parent, json_link) end end next if json_folder[@key_folder].nil? || json_folder[@key_folder].empty? construct_tree(json_folder[@key_folder]) end end |