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

#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.



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

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, data: @ldp_source.graph.graph.data)
end

#set_value(*args) ⇒ Object

Override ActiveTriples method for setting properties

Raises:



31
32
33
34
# File 'lib/active_fedora/fedora_attributes.rb', line 31

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