Class: Folder

Inherits:
BaseFile show all
Defined in:
lib/dynalist/folder.rb

Constant Summary

Constants inherited from BaseFile

BaseFile::PERMISSION

Instance Attribute Summary

Attributes inherited from BaseFile

#id, #title, #type

Instance Method Summary collapse

Methods inherited from BaseFile

#include, #permission

Constructor Details

#initialize(id: nil, title: nil, type: nil, permission: nil, collapsed: false, children: []) ⇒ Folder

Returns a new instance of Folder.



4
5
6
7
8
# File 'lib/dynalist/folder.rb', line 4

def initialize(id: nil, title: nil, type: nil, permission: nil, collapsed: false, children: [])
  @collapsed = collapsed
  @children_ids = children
  super(id: id, title: title, type: 'folder', permission: permission)
end

Instance Method Details

#childrenObject



14
15
16
# File 'lib/dynalist/folder.rb', line 14

def children
  FileTree.where(id: @children_ids)
end

#collapsed?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/dynalist/folder.rb', line 10

def collapsed?
  @collapsed
end