Class: ActiveFedora::LdpResource

Inherits:
Ldp::Resource::RdfSource
  • Object
show all
Defined in:
lib/active_fedora/ldp_resource.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.graph_classObject



7
8
9
# File 'lib/active_fedora/ldp_resource.rb', line 7

def self.graph_class
  ActiveTriples::Resource
end

Instance Method Details

#build_empty_graphObject



3
4
5
# File 'lib/active_fedora/ldp_resource.rb', line 3

def build_empty_graph
  graph_class.new(subject_uri)
end

#graph_classObject



11
12
13
# File 'lib/active_fedora/ldp_resource.rb', line 11

def graph_class
  self.class.graph_class
end

#marshal_dumpObject

Don’t dump @client, it has a proc and thus can’t be serialized.



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

def marshal_dump
  (instance_variables - [:@client]).map { |name| [name, instance_variable_get(name)] }
end

#marshal_load(data) ⇒ Object



20
21
22
# File 'lib/active_fedora/ldp_resource.rb', line 20

def marshal_load(data)
  data.each { |name, val| instance_variable_set(name, val) }
end