Class: ScopusRemote

Inherits:
Object
  • Object
show all
Defined in:
lib/scopus_remote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScopusRemote

Returns a new instance of ScopusRemote.



35
36
37
38
# File 'lib/scopus_remote.rb', line 35

def initialize
  @scopus=ElsevierApi::Connection.new(ENV["SCOPUS_KEY"], :proxy_host => ENV["PROXY_HOST"], :proxy_port => ENV["PROXY_PORT"], :proxy_user => ENV["PROXY_USER"], :proxy_pass => ENV["PROXY_PASS"])
  @error=nil
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



33
34
35
# File 'lib/scopus_remote.rb', line 33

def error
  @error
end

#scopusObject (readonly)

Returns the value of attribute scopus.



32
33
34
# File 'lib/scopus_remote.rb', line 32

def scopus
  @scopus
end

Instance Method Details

#xml_abstract_by_id(id, type = "doi") ⇒ Object

Parameters:

  • id

    Id to retrieve. By default, doi

  • type (defaults to: "doi")

    type of identifier. By default, doi, but could it be eid



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/scopus_remote.rb', line 42

def xml_abstract_by_id(id, type="doi")
    uri_abstract=@scopus.get_uri_abstract(CGI.escapeElement(id), type=type, {})
    xml=@scopus.retrieve_response(uri_abstract)
    if @scopus.error
      #$log.info(@scopus.error_msg)
      @error=@scopus.error_msg
      false
    else
      xml
    end
    
end