return auth token on login

parent 0a368c6f
Gem::Specification.new do |s|
s.name = 'dspace_rest_client'
s.version = '1.1.0'
s.version = '1.1.1'
s.date = '2015-04-17'
s.summary = "DSpace REST-API Client for Ruby!"
s.description = "DSpace REST-API Client for Ruby! Implements all DSpace REST-API endpoints requests."
s.authors = ["Mauricio Giacomini Girardello", "Bruno N. Zanette"]
s.authors = ["Mauricio Giacomini Girardello", "Bruno N. Zanette", "Mateus Rambo Strey"]
s.email = 'c3sl@c3sl.ufpr.br'
s.files = Dir['lib/*.rb'] +
Dir['lib/dspacerest/*.rb'] +
......
......@@ -3,9 +3,14 @@ require 'rest-client'
class DspaceClient
attr_reader :rest_client
def initialize(url)
def initialize(url, authenticated_token = nil)
@url = url
@rest_client = build_rest_client url
if (authenticated_token.nil?)
@rest_client = build_rest_client url
else
@rest_client = build_rest_client url, rest_dspace_token: authenticated_token
end
end
def repository
......@@ -25,7 +30,7 @@ class DspaceClient
@rest_client = build_rest_client @url, rest_dspace_token: authenticated_token
@dspace_repository = build_repository @rest_client
return (!authenticated_token.nil?)
authenticated_token
end
def logout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment