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:



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

def initialize(applicators)
  @applicators = applicators
end

Instance Attribute Details

#applicatorsObject (readonly)

Returns the value of attribute applicators.



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

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)


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

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