class ActiveFedora::Merged
Represents the result of merging two association hashes. @note As the keys can come from multiple models, the attributes become unwritable.
Attributes
first[R]
second[R]
Public Class Methods
new(first, second)
click to toggle source
rubocop:disable Lint/MissingSuper
# File lib/active_fedora/association_hash.rb, line 96 def initialize(first, second) @first = first @base = first.base @second = second end
Public Instance Methods
[](name)
click to toggle source
rubocop:enable Lint/MissingSuper
# File lib/active_fedora/association_hash.rb, line 103 def [](name) first[name] || second[name] end
[]=(_name)
click to toggle source
# File lib/active_fedora/association_hash.rb, line 107 def []=(_name) raise NotImplementedError, "Unable to set properties on a merged association hash." end
keys()
click to toggle source
# File lib/active_fedora/association_hash.rb, line 111 def keys first.keys + second.keys end