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 comparsions

    • 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



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

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



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

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



28
29
30
# File 'lib/stanford/active_fedora_object.rb', line 28

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