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

acceptable_methods, all, api_path, #attributes, available?, #delete, delete, get, #get, index_field, #initialize, nil_as_string, passwordstate_to_ruby_field, passwordstateify_hash, post, #post, #pretty_print, 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



34
35
36
37
38
# File 'lib/passwordstate/resources/folder.rb', line 34

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

  tree_path
end

#password_listsObject



20
21
22
23
24
25
26
27
# File 'lib/passwordstate/resources/folder.rb', line 20

def password_lists
  Passwordstate::ResourceList.new Passwordstate::Resources::PasswordList,
                                  client: client,
                                  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



29
30
31
32
# File 'lib/passwordstate/resources/folder.rb', line 29

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