Class: Vaulty::VaultTree::Folder

Inherits:
Object
  • Object
show all
Defined in:
lib/vaulty/vault_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, data:, children:) ⇒ Folder

Returns a new instance of Folder.



5
6
7
8
9
# File 'lib/vaulty/vault_tree.rb', line 5

def initialize(name:, data:, children:)
  @name = name
  @data = data
  @children = children
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



4
5
6
# File 'lib/vaulty/vault_tree.rb', line 4

def children
  @children
end

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/vaulty/vault_tree.rb', line 4

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/vaulty/vault_tree.rb', line 4

def name
  @name
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/vaulty/vault_tree.rb', line 11

def empty?
  data.empty? && children.empty?
end