Class: Pho::OAI::Statistics

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

Overview

Access basic store statistics via the OAI interface

Class Method Summary collapse

Class Method Details

.last_updated(store) ⇒ Object

Datestamp of last updated record in the store

This reads the OAI-PMH interface and retrieves the datestamp of the most recently updated item



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

def Statistics.last_updated(store)
  records = Records.read_from_store(store)
  return records.records[0].datestamp
end

.num_of_entities(store) ⇒ Object

Number of entities in the store. This includes all resources in both the metabox AND the contentbox



20
21
22
23
24
25
26
27
# File 'lib/pho/oai.rb', line 20

def Statistics.num_of_entities(store)
  records = Records.read_from_store(store)
  if records.resumption_token != nil
    return records.list_size
  else 
    return records.records.length
  end
end