Class: ElVfs::Command::GetAncestors::Result

Inherits:
Result
  • Object
show all
Defined in:
lib/el_finder_api/el_vfs/command/get_ancestors.rb

Instance Attribute Summary

Attributes inherited from Result

#arguments, #execute_command

Instance Method Summary collapse

Methods inherited from Model

#attributes=, #el_hash, #initialize, options, #to_el_hash

Constructor Details

This class inherits a constructor from ElVfs::Model

Instance Method Details

#treeObject



12
13
14
15
16
17
18
# File 'lib/el_finder_api/el_vfs/command/get_ancestors.rb', line 12

def tree
  tree = arguments.entry.ancestors
  tree += arguments.entry.ancestors.from_depth(1).map(&:directories).flatten
  tree << arguments.entry
  tree += Entry.where(['ancestry_depth <= ?', 2]).only_directories
  tree.uniq
end