Class: Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/valkyrie/persistence/fedora/persister/orm_converter.rb

Defined Under Namespace

Classes: Applicator, BlacklistedValue, BooleanValue, CompositeApplicator, CreatedAtValue, DateTimeValue, DifferentSubject, FedoraValue, IntegerValue, InternalModelValue, InternalURI, LiteralValue, MemberID, NestedValue, NonStringSingleApplicator, NullApplicator, Property, SingleApplicator, TimeValue, UpdatedAtValue, ValkyrieIDValue

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(graph:, adapter:) ⇒ GraphToAttributes



34
35
36
37
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 34

def initialize(graph:, adapter:)
  @graph = graph
  @adapter = adapter
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



33
34
35
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 33

def adapter
  @adapter
end

#graphObject (readonly)

Returns the value of attribute graph.



33
34
35
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 33

def graph
  @graph
end

Instance Method Details

#attributesObject



46
47
48
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 46

def attributes
  @attributes ||= {}
end

#convertObject



39
40
41
42
43
44
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 39

def convert
  graph.each do |statement|
    FedoraValue.for(Property.new(statement: statement, scope: graph, adapter: adapter)).result.apply_to(attributes)
  end
  attributes
end