Class: ActiveFedora::Associations::RecordComposite

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/active_fedora/associations/record_composite.rb

Overview

A Composite for records - currently only supports delete interface. The goal is to push commands down to the containing records.

Defined Under Namespace

Classes: Repository

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(records:) ⇒ RecordComposite

Returns a new instance of RecordComposite.



8
9
10
# File 'lib/active_fedora/associations/record_composite.rb', line 8

def initialize(records:)
  @records = records
end

Instance Attribute Details

#recordsObject (readonly)

Returns the value of attribute records.



6
7
8
# File 'lib/active_fedora/associations/record_composite.rb', line 6

def records
  @records
end

Instance Method Details

#deleteObject



18
19
20
# File 'lib/active_fedora/associations/record_composite.rb', line 18

def delete
  each(&:delete)
end

#eachObject



12
13
14
15
16
# File 'lib/active_fedora/associations/record_composite.rb', line 12

def each
  records.each do |record|
    yield record
  end
end