Class: ActiveFedora::Associations::DeleteProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/associations/delete_proxy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proxy_ids:, proxy_class:) ⇒ DeleteProxy

Returns a new instance of DeleteProxy.



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

def initialize(proxy_ids:, proxy_class:)
  @proxy_ids = proxy_ids
  @proxy_class = proxy_class
end

Instance Attribute Details

#proxy_classObject (readonly)

Returns the value of attribute proxy_class.



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

def proxy_class
  @proxy_class
end

#proxy_idsObject (readonly)

Returns the value of attribute proxy_ids.



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

def proxy_ids
  @proxy_ids
end

Class Method Details

.call(proxy_ids:, proxy_class:) ⇒ Object



3
4
5
# File 'lib/active_fedora/associations/delete_proxy.rb', line 3

def self.call(proxy_ids:, proxy_class:)
  new(proxy_ids: proxy_ids, proxy_class: proxy_class).run
end

Instance Method Details

#runObject



13
14
15
# File 'lib/active_fedora/associations/delete_proxy.rb', line 13

def run
  proxies.each(&:delete)
end