Class: Passwordstate::Resources::Folder

Inherits:
Passwordstate::Resource show all
Defined in:
lib/passwordstate/resources/folder.rb

Instance Attribute Summary

Attributes inherited from Passwordstate::Resource

#client

Instance Method Summary collapse

Methods inherited from Passwordstate::Resource

all, api_path, #api_path, #attributes, available?, #delete, delete, get, #get, index_field, #initialize, #inspect, nil_as_string, passwordstate_to_ruby_field, passwordstateify_hash, post, #post, put, #put, ruby_to_passwordstate_field, #stored?

Constructor Details

This class inherits a constructor from Passwordstate::Resource

Instance Method Details

#full_path(unix = false) ⇒ Object



31
32
33
34
35
# File 'lib/passwordstate/resources/folder.rb', line 31

def full_path(unix = false)
  return tree_path.tr('\\', '/') if unix

  tree_path
end

#password_listsObject



18
19
20
21
22
23
24
# File 'lib/passwordstate/resources/folder.rb', line 18

def password_lists
  Passwordstate::ResourceList.new client, Passwordstate::Resources::PasswordList,
                                  search_query: { tree_path: tree_path },
                                  all_path: 'searchpasswordlists',
                                  all_query: { tree_path: tree_path },
                                  object_data: { nest_undef_folder_id: folder_id }
end

#permissionsObject



26
27
28
29
# File 'lib/passwordstate/resources/folder.rb', line 26

def permissions
  client.require_version('>= 8.4.8449')
  FolderPermission.new(_client: client, folder_id: folder_id)
end