Class: Stanford::ActiveFedoraObject

Inherits:
Object
  • Object
show all
Defined in:
lib/stanford/active_fedora_object.rb

Overview

Note:

Copyright © 2012 by The Board of Trustees of the Leland Stanford Junior University. All rights reserved. See LICENSE for details.

Utility Class for extracting content or other information from a Fedora Instance

Data Model

  • DorMetadata = utility methods for interfacing with Stanford metadata files (esp contentMetadata)

    • ContentInventory [1..1] = utilities for transforming contentMetadata to versionInventory and doing comparisons

    • ActiveFedoraObject [1..*] = utility for extracting content or other information from a Fedora Instance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fedora_object) ⇒ Stanford::ActiveFedoraObject

Returns Create a u.

Parameters:

  • fedora_object (Object)

    The Active Fedora representation of the Fedora Object



14
15
16
# File 'lib/stanford/active_fedora_object.rb', line 14

def initialize(fedora_object)
  @fedora_object = fedora_object
end

Instance Attribute Details

#fedora_objectObject

Returns The Active Fedora representation of the Fedora Object.

Returns:

  • (Object)

    The Active Fedora representation of the Fedora Object



19
20
21
# File 'lib/stanford/active_fedora_object.rb', line 19

def fedora_object
  @fedora_object
end

Instance Method Details

#get_datastream_content(ds_id) ⇒ String

Returns The content of the specified datastream.

Parameters:

  • ds_id (String)

    The datastream identifier

Returns:

  • (String)

    The content of the specified datastream



24
25
26
# File 'lib/stanford/active_fedora_object.rb', line 24

def get_datastream_content(ds_id)
  @fedora_object.datastreams[ds_id].content
end