Class: OAI::IdentifyResponse

Inherits:
Response show all
Includes:
XPath
Defined in:
lib/oai/client/identify.rb

Instance Attribute Summary collapse

Attributes inherited from Response

#doc, #resumption_block, #resumption_token

Instance Method Summary collapse

Methods included from XPath

#get_attribute, #xpath, #xpath_all, #xpath_first

Constructor Details

#initialize(doc) ⇒ IdentifyResponse

Returns a new instance of IdentifyResponse.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/oai/client/identify.rb', line 7

def initialize(doc)
  super doc
  @repository_name = xpath(doc, './/Identify/repositoryName')
  @base_url = xpath(doc, './/Identify/baseURL')
  @protocol = xpath(doc, './/Identify/protocol')
  @admin_email = xpath(doc, './/Identify/adminEmail')
  @earliest_datestamp = xpath(doc, './/Identify/earliestDatestamp')
  @deleted_record = xpath(doc, './/Identify/deletedRecord')
  @granularity = xpath(doc, './/Identify/granularity')
  @compression = xpath(doc, '..//Identify/compression')
end

Instance Attribute Details

#admin_emailObject

Returns the value of attribute admin_email.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def admin_email
  @admin_email
end

#base_urlObject

Returns the value of attribute base_url.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def base_url
  @base_url
end

#compressionObject

Returns the value of attribute compression.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def compression
  @compression
end

#deleted_recordObject

Returns the value of attribute deleted_record.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def deleted_record
  @deleted_record
end

#earliest_datestampObject

Returns the value of attribute earliest_datestamp.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def earliest_datestamp
  @earliest_datestamp
end

#granularityObject

Returns the value of attribute granularity.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def granularity
  @granularity
end

#protocolObject

Returns the value of attribute protocol.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def protocol
  @protocol
end

#repository_nameObject

Returns the value of attribute repository_name.



4
5
6
# File 'lib/oai/client/identify.rb', line 4

def repository_name
  @repository_name
end

Instance Method Details

#descriptionsObject

returns REXML::Element nodes for each description section if the OAI::Client was configured to use libxml then you will instead get a LibXML::XML::Node object.



26
27
28
# File 'lib/oai/client/identify.rb', line 26

def descriptions
  return xpath_all(doc, './/Identify/description')
end

#to_sObject



19
20
21
# File 'lib/oai/client/identify.rb', line 19

def to_s
  return "#{@repository_name} [#{@base_url}]"
end