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

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

Overview

Class for handling Arrays of Properties

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(applicators) ⇒ CompositeApplicator

Returns a new instance of CompositeApplicator.

Parameters:



140
141
142
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 140

def initialize(applicators)
  @applicators = applicators
end

Instance Attribute Details

#applicatorsObject (readonly)

Returns the value of attribute applicators.



137
138
139
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 137

def applicators
  @applicators
end

Instance Method Details

#apply_to(hsh) ⇒ Hash

Enumerate through the Applicator constructed for each Property

updating the Valkyrie resource attribute Hash with each result

Parameters:

  • hsh (Hash)

    a new or existing Hash of attribute for Valkyrie resource attributes

Returns:

  • (Hash)


148
149
150
151
152
153
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 148

def apply_to(hsh)
  applicators.each do |applicator|
    applicator.apply_to(hsh)
  end
  hsh
end