Class: Libis::Services::Oai::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/libis/services/oai.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Query

Returns a new instance of Query.



13
14
15
16
# File 'lib/libis/services/oai.rb', line 13

def initialize(options = {})
  @options = options
  @options[:metadata_prefix] ||= 'oai_dc'
end

Instance Method Details

#[](key, value) ⇒ Object



18
19
20
# File 'lib/libis/services/oai.rb', line 18

def [](key, value)
  @options[key] = value
end

#to_hashObject



22
23
24
25
26
27
28
29
30
# File 'lib/libis/services/oai.rb', line 22

def to_hash
  { 
    from: @options[:from],
    until: @options[:until],
    metadata_prefix: @options[:metadata_prefix],
    set: @options[:set],
    resumption_token: @options[:token] || @options[:resumption_token]
  }.cleanup
end