Class OpenURL::ContextObject
In: lib/openurl/context_object.rb
Parent: Object

Methods

Attributes

admin  [R] 
custom  [RW] 
referent  [RW] 
referrer  [RW] 
referringEntity  [RW] 
requestor  [RW] 
resolver  [RW] 
serviceType  [RW] 

Public Class methods

Creates a new ContextObject object and initializes the ContextObjectEntities.

Initialize a new ContextObject object from an existing key/value hash

Initialize a new ContextObject object from an existing KEV

Initialize a new ContextObject object from an existing XML ContextObject

Public Instance methods

Adds a custom entity to the ContextObject and returns array index of the new object. Expects an abbreviation and label for KEV and XML output.

Adds another Resolver entity to the context object and returns the array index of the new object.

Adds another ServiceType entity to the context object and returns the array index of the new object.

Outputs a COinS (ContextObject in SPANS) span tag for the ContextObject. Arguments are any other CSS classes you want included and the innerHTML content.

Returns the appropriate CustomEntity for the given entity abbreviation.

Imports an existing OpenURL::ContextObject object and sets the appropriate entity values.

Imports an existing hash of ContextObject values and sets the appropriate entities.

Imports an existing Key-encoded value string and sets the appropriate entities.

Imports an existing XML encoded context object and sets the appropriate entities

Output the ContextObject as a Key-encoded value string. Pass a boolean true argument if you do not want the ctx_tim key included.

Alias for .kev

Alias for .xml

Searches the Custom Entities for the key/value pair and returns an array of the @custom array keys of any matches.

Outputs the ContextObject as a ruby hash.

Translates the abbreviated entity (rft, rfr, etc.) to the associated class name. For repeatable entities, uses the first object in the array. Returns a string of the object name which would then be eval‘ed to call a method upon.

Serialize the ContextObject to XML.

Protected Instance methods

Parses the data that should apply to all XML context objects

Parses metadata-by-val data

Referent and ReferringEntities place their metadata-by-val inside the format element

[Validate]