Class: Duse::Client::Folder

Inherits:
Entity
  • Object
show all
Defined in:
lib/duse/client/folder.rb

Constant Summary collapse

FOLDER_SYMBOL =
'📂'

Constants inherited from Entity

Entity::MAP

Instance Attribute Summary

Attributes inherited from Entity

#attributes, #curry

Instance Method Summary collapse

Methods inherited from Entity

add_attribute, attributes, base_path, #delete, id_field, ignore_in_json, #initialize, #load_attribute, many, #missing?, one, #reload, #save, #set_attribute, subclasses, #to_h

Constructor Details

This class inherits a constructor from Duse::Client::Entity

Instance Method Details

#childrenObject



20
21
22
# File 'lib/duse/client/folder.rb', line 20

def children
  self.subfolders + self.secrets
end

#id_nameObject



24
25
26
27
# File 'lib/duse/client/folder.rb', line 24

def id_name
  return "#{FOLDER_SYMBOL}  #{self.name}" if self.id.nil?
  "#{FOLDER_SYMBOL}  #{self.id}: #{self.name}"
end

#to_sObject



29
30
31
# File 'lib/duse/client/folder.rb', line 29

def to_s
  "#{FOLDER_SYMBOL}  #{self.name}"
end