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.
137 138 139 |
# File 'lib/valkyrie/persistence/fedora/list_node.rb', line 137 def graph @graph end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
137 138 139 |
# File 'lib/valkyrie/persistence/fedora/list_node.rb', line 137 def uri @uri end |
Class Method Details
.property(property, predicate:) ⇒ Object
121 122 123 124 125 126 127 128 129 130 |
# File 'lib/valkyrie/persistence/fedora/list_node.rb', line 121 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 |