Class: ActiveFedora::Relation::Merger

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/relation/merger.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relation, other) ⇒ Merger

Returns a new instance of Merger.



9
10
11
12
13
# File 'lib/active_fedora/relation/merger.rb', line 9

def initialize(relation, other)
  @relation = relation
  @values   = other.values
  @other    = other
end

Instance Attribute Details

#otherObject (readonly)

Returns the value of attribute other.



7
8
9
# File 'lib/active_fedora/relation/merger.rb', line 7

def other
  @other
end

#relationObject (readonly)

Returns the value of attribute relation.



7
8
9
# File 'lib/active_fedora/relation/merger.rb', line 7

def relation
  @relation
end

#valuesObject (readonly)

Returns the value of attribute values.



7
8
9
# File 'lib/active_fedora/relation/merger.rb', line 7

def values
  @values
end

Instance Method Details

#mergeObject



15
16
17
18
19
20
# File 'lib/active_fedora/relation/merger.rb', line 15

def merge
  # TODO: merge order
  # See https://github.com/samvera/active_fedora/issues/1329
  relation.where_values += other.where_values
  relation
end