Class: Folder
Constant Summary
Constants inherited from BaseFile
Instance Attribute Summary
Attributes inherited from BaseFile
Instance Method Summary collapse
- #children ⇒ Object
- #collapsed? ⇒ Boolean
-
#initialize(id: nil, title: nil, type: nil, permission: nil, collapsed: false, children: []) ⇒ Folder
constructor
A new instance of Folder.
Methods inherited from BaseFile
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: ) end |
Instance Method Details
#children ⇒ Object
14 15 16 |
# File 'lib/dynalist/folder.rb', line 14 def children FileTree.where(id: @children_ids) end |
#collapsed? ⇒ Boolean
10 11 12 |
# File 'lib/dynalist/folder.rb', line 10 def collapsed? @collapsed end |