Class: Valkyrie::Persistence::Fedora::ListNode::Resource
- Inherits:
-
Object
- Object
- Valkyrie::Persistence::Fedora::ListNode::Resource
- Defined in:
- lib/valkyrie/persistence/fedora/list_node.rb
Overview
Class for providing a set of triples modeling linked list nodes
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(uri, graph: RDF::Graph.new) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
140 141 142 |
# File 'lib/valkyrie/persistence/fedora/list_node.rb', line 140 def graph @graph end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
140 141 142 |
# File 'lib/valkyrie/persistence/fedora/list_node.rb', line 140 def uri @uri end |
Class Method Details
.property(property, predicate:) ⇒ Object
124 125 126 127 128 129 130 131 132 133 |
# File 'lib/valkyrie/persistence/fedora/list_node.rb', line 124 def self.property(property, predicate:) define_method property do graph.query([uri, predicate, nil]).objects.first end define_method "#{property}=" do |val| return if val.nil? graph << [uri, predicate, val] end end |