Class: OAI::Record
Overview
A class for representing a Record as returned from a GetRecord or ListRecords request. Each record will have a header and metadata attribute. The header is a OAI::Header object and the metadata is a REXML::Element object for that chunk of XML.
Note: if your OAI::Client was configured to use the ‘libxml’ parser metadata will return a XML::Node object instead.
Instance Attribute Summary collapse
-
#header ⇒ Object
Returns the value of attribute header.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#deleted? ⇒ Boolean
a convenience method which digs into the header status attribute and returns true if the value is set to ‘deleted’.
-
#initialize(element) ⇒ Record
constructor
A new instance of Record.
Methods included from XPath
#get_attribute, #xpath, #xpath_all, #xpath_first
Constructor Details
Instance Attribute Details
#header ⇒ Object
Returns the value of attribute header.
13 14 15 |
# File 'lib/oai/client/record.rb', line 13 def header @header end |
#metadata ⇒ Object
Returns the value of attribute metadata.
13 14 15 |
# File 'lib/oai/client/record.rb', line 13 def @metadata end |
Instance Method Details
#deleted? ⇒ Boolean
a convenience method which digs into the header status attribute and returns true if the value is set to ‘deleted’
22 23 24 |
# File 'lib/oai/client/record.rb', line 22 def deleted? return @header.deleted? end |