Class: RetrieveRequest

Inherits:
Request show all
Defined in:
lib/refworks/retrieve/retrieve_request.rb

Class Method Summary collapse

Methods inherited from Request

generate_signature, http_request_verb

Class Method Details

.call_classObject



2
3
4
# File 'lib/refworks/retrieve/retrieve_request.rb', line 2

def self.call_class
  "retrieve"
end

.generate_class_params(params) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/refworks/retrieve/retrieve_request.rb', line 6

def self.generate_class_params(params)
  # handle params common to all Retrieve calls
  class_name = call_class()

  # query parameters common to all Retrieve calls
  {
    :class => class_name,
    :pgsize => params[:pgsize] || 50,
    :pgnum => params[:pgnum] || 1,
    :format => params[:format] || 'html',
    :sort => params[:sort], # no default set; according to API, default depends on method called
    :style => 0,  # no alternate styles currently supported; passed-in param will be ignored
    :language => 'en', # only differs if a style is set, which is not possible currently; passed-in param ignored
    :biblist => 'false' # only differs if a style is set, which is not possible currently; passed-in param ignored
  }
end