Class: OAI::Header

Inherits:
Object
  • Object
show all
Includes:
XPath
Defined in:
lib/oai/client/header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XPath

#get_attribute, #xpath, #xpath_all, #xpath_first

Constructor Details

#initialize(element) ⇒ Header

Returns a new instance of Header.



6
7
8
9
10
11
# File 'lib/oai/client/header.rb', line 6

def initialize(element)
  @status = get_attribute(element, 'status')
  @identifier = xpath(element, './/identifier')
  @datestamp = xpath(element, './/datestamp')
  @set_spec = xpath_all(element, './/setSpec')
end

Instance Attribute Details

#datestampObject

Returns the value of attribute datestamp.



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

def datestamp
  @datestamp
end

#identifierObject

Returns the value of attribute identifier.



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

def identifier
  @identifier
end

#set_specObject

Returns the value of attribute set_spec.



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

def set_spec
  @set_spec
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/oai/client/header.rb', line 13

def deleted?
  return true if @status.to_s == "deleted"
end