Module: ActiveFedora::Model

Defined in:
lib/active_fedora/model.rb

Overview

ActiveFedora

This module mixes various methods into the including class, much in the way ActiveRecord does.

Class Method Summary collapse

Class Method Details

.class_from_string(*args) ⇒ Object

Deprecated.

Convenience method for getting class constant based on a string

Examples:

ActiveFedora::Model.class_from_string("Om")
=> Om
ActiveFedora::Model.class_from_string("ActiveFedora::RdfNode::TermProxy")
=> ActiveFedora::RdfNode::TermProxy

Search within ActiveFedora::RdfNode for a class called “TermProxy”

ActiveFedora::Model.class_from_string("TermProxy", ActiveFedora::RdfNode)
=> ActiveFedora::RdfNode::TermProxy


16
17
18
19
# File 'lib/active_fedora/model.rb', line 16

def self.class_from_string(*args)
  Deprecation.warn("ActiveFedora::Model.class_from_string has been deprecated and will be removed in ActiveFedora 10.0. Use ActiveFedora::ModelClassifier.class_from_string instead")
  ActiveFedora::ModelClassifier.class_from_string(*args)
end

.from_class_uri(model_value) ⇒ Class, False

Deprecated.

Takes a Fedora URI for a cModel, and returns a corresponding Model if available This method should reverse ClassMethods#to_class_uri

Returns:

  • (Class, False)

    the class of the model or false, if it does not exist



26
27
28
29
# File 'lib/active_fedora/model.rb', line 26

def self.from_class_uri(model_value)
  Deprecation.warn("ActiveFedora::Model.from_class_uri has been deprecated and will be removed in ActiveFedora 10.0. Use ActiveFedora::ModelClassifier.from_class_uri instead")
  ActiveFedora::ModelClassifier.new(Array(model_value)).best_model
end