diff --git a/lib/passwordstate/client.rb b/lib/passwordstate/client.rb index 1153aae1a8c4669c14643a0efe2b0c7602877d14..b8a5da696b2edd38f7feb53de72dec81e4bb8b65 100644 --- a/lib/passwordstate/client.rb +++ b/lib/passwordstate/client.rb @@ -35,21 +35,25 @@ module Passwordstate end def folders - ResourceList.new self, Passwordstate::Resources::Folder, + ResourceList.new Passwordstate::Resources::Folder, + client: self, only: %i[all search post] end def hosts - ResourceList.new self, Passwordstate::Resources::Host, + ResourceList.new Passwordstate::Resources::Host, + client: self, except: %i[search put] end def passwords - ResourceList.new self, Passwordstate::Resources::Password + ResourceList.new Passwordstate::Resources::Password, + client: self end def password_lists - ResourceList.new self, Passwordstate::Resources::PasswordList, + ResourceList.new Passwordstate::Resources::PasswordList, + client: self, except: %i[put delete] end diff --git a/lib/passwordstate/resource_list.rb b/lib/passwordstate/resource_list.rb index 2727b691c7d6b5c6d54f2a11e86078196b672ea9..2ce77e34ffe9326a5171f0b78f16e51518af9126 100644 --- a/lib/passwordstate/resource_list.rb +++ b/lib/passwordstate/resource_list.rb @@ -28,7 +28,7 @@ module Passwordstate attr_reader :client, :resource, :options - def initialize(client, resource, options = {}) + def initialize(resource, client:, **options) @client = client @resource = resource @loaded = false