class Fieldhand::Set

A set is an optional construct for grouping items for the purpose of selective harvesting.

See www.openarchives.org/OAI/openarchivesprotocol.html#Set

Attributes

element[R]
response_date[R]

Public Class Methods

new(element, response_date = Time.now) click to toggle source

Return a Set with the given element and optional response date.

Defaults the response date to the current time.

# File lib/fieldhand/set.rb, line 15
def initialize(element, response_date = Time.now)
  @element = element
  @response_date = response_date
end

Public Instance Methods

descriptions() click to toggle source

Return any descriptions of the set as an array of strings.

As descriptions can be in any format, Fieldhand does not attempt to parse them but leave this to the user.

# File lib/fieldhand/set.rb, line 40
def descriptions
  @descriptions ||= element.locate('setDescription').map { |description| Ox.dump(description) }
end
name() click to toggle source

Return the set's short human-readable name.

# File lib/fieldhand/set.rb, line 33
def name
  @name ||= element.setName.text
end
spec() click to toggle source

Return the set's unique identifier within the repository.

# File lib/fieldhand/set.rb, line 28
def spec
  @spec ||= element.setSpec.text
end
to_s() click to toggle source

Return the set's spec as its string representation.

This means that Sets can be used as arguments that expect a set spec.

# File lib/fieldhand/set.rb, line 23
def to_s
  spec
end