Module: ActiveFedora::FedoraAttributes

Extended by:
ActiveSupport::Concern
Includes:
InheritableAccessors
Included in:
Base
Defined in:
lib/active_fedora/fedora_attributes.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#rdf_labelObject

You can set the URI to use for the rdf_label on ClassMethods.rdf_label, then on the instance, calling rdf_label returns the value of that configured property



50
51
52
# File 'lib/active_fedora/fedora_attributes.rb', line 50

def rdf_label
  resource.rdf_label
end

#resourceObject

The resource is the RdfResource object that stores the graph for the datastream and is the central point for its relationship to other nodes.

set_value, get_value, and property accessors are delegated to this object.



41
42
43
44
45
46
# File 'lib/active_fedora/fedora_attributes.rb', line 41

def resource
  # Appending the graph at the end is necessary because adding it as the
  # parent leaves behind triples not related to the ldp_source's rdf
  # subject.
  @resource ||= self.class.resource_class.new(@ldp_source.graph.rdf_subject, @ldp_source.graph) << @ldp_source.graph
end

#set_value(*args) ⇒ Object

Override ActiveTriples method for setting properties

Raises:



29
30
31
32
# File 'lib/active_fedora/fedora_attributes.rb', line 29

def set_value(*args)
  raise ReadOnlyRecord if readonly?
  resource.set_value(*args)
end