Class OpenURL::ContextObjectEntity
In: lib/openurl/context_object_entity.rb
Parent: Object

The ContextObjectEntity is a generic class to define an entity. It should not be initialized directly, only through one of its children:

  ReferentEntity, ReferrerEntity, ReferringEntity, ResolverEntity,
  ServiceTypeEntity, or CustomEntity

Methods

Attributes

abbr  [R]  identifiers should always be an array, but it might be an empty one.
format  [R]  identifiers should always be an array, but it might be an empty one.
identifiers  [R]  identifiers should always be an array, but it might be an empty one.
label  [R]  identifiers should always be an array, but it might be an empty one.
metadata  [R]  identifiers should always be an array, but it might be an empty one.
private_data  [R]  identifiers should always be an array, but it might be an empty one.
reference  [R]  identifiers should always be an array, but it might be an empty one.

Public Class methods

Switch old 0.1 style ids to new 1.0 style ids. Eg, turn << doi:[x] >> into << info:doi/[x] >>

Public Instance methods

Should really be called "add identifier", since we can have more than one. But for legacy, it‘s "set_identifier".

Checks to see if the entity has any metadata set.

We can actually have more than one, but certain code calls this method as if there‘s only one. We return the first.

Outputs the entity as a KEV array

set_identifier(val)

Alias for add_identifier

Sets the location and format of a by-reference context object entity

Outputs the entity as a hash

Serializes the entity to XML and attaches it to the supplied REXML element.

Serializes the metadata values for Referent and ReferringEntity entities since their schema is a little different.

[Validate]