class Test def self.create_client dspace_client = Dspace::Client.new(dspace_api: config['link']) dspace_client.login config['login'], config['password'] dspace_client end private def self.config {'link' => "https://mecdb3.c3sl.ufpr.br:8443", 'login' => "admin@mecdb3.c3sl.ufpr.br", 'password' => 'admin'} end end item= Dspace::Item.new({ 'name' => 'testeeeee' }) dspace = Test.create_client p dspace.collections.create_item(item, id: 4)