Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::Property
- Inherits:
-
Object
- Object
- Valkyrie::Persistence::Fedora::Persister::ModelConverter::Property
- Defined in:
- lib/valkyrie/persistence/fedora/persister/model_converter.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(subject, key, value, adapter, resource) ⇒ Property
constructor
A new instance of Property.
- #predicate ⇒ Object
- #to_graph(graph = RDF::Graph.new) ⇒ Object
Constructor Details
#initialize(subject, key, value, adapter, resource) ⇒ Property
Returns a new instance of Property.
47 48 49 50 51 52 53 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 47 def initialize(subject, key, value, adapter, resource) @subject = subject @key = key @value = value @adapter = adapter @resource = resource end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
44 45 46 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 44 def adapter @adapter end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
44 45 46 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 44 def key @key end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
44 45 46 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 44 def resource @resource end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
44 45 46 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 44 def subject @subject end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
44 45 46 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 44 def value @value end |
Instance Method Details
#predicate ⇒ Object
62 63 64 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 62 def predicate schema.predicate_for(resource: resource, property: key) end |
#to_graph(graph = RDF::Graph.new) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 55 def to_graph(graph = RDF::Graph.new) Array(value).each do |val| graph << RDF::Statement.new(subject, predicate, val) end graph end |