module Shrine::Plugins::Mirroring::ClassMethods

  1. lib/shrine/plugins/mirroring.rb

Public Instance methods

mirror_delete?()
[show source]
   # File lib/shrine/plugins/mirroring.rb
47 def mirror_delete?
48   opts[:mirroring][:delete]
49 end
mirror_delete_block(&block)
[show source]
   # File lib/shrine/plugins/mirroring.rb
35 def mirror_delete_block(&block)
36   if block
37     opts[:mirroring][:delete_block] = block
38   else
39     opts[:mirroring][:delete_block]
40   end
41 end
mirror_upload?()
[show source]
   # File lib/shrine/plugins/mirroring.rb
43 def mirror_upload?
44   opts[:mirroring][:upload]
45 end
mirror_upload_block(&block)
[show source]
   # File lib/shrine/plugins/mirroring.rb
27 def mirror_upload_block(&block)
28   if block
29     opts[:mirroring][:upload_block] = block
30   else
31     opts[:mirroring][:upload_block]
32   end
33 end
mirrors(storage_key = nil)
[show source]
   # File lib/shrine/plugins/mirroring.rb
15 def mirrors(storage_key = nil)
16   if storage_key
17     mirrors = opts[:mirroring][:mirror][storage_key]
18 
19     fail Error, "no mirrors registered for storage #{storage_key.inspect}" unless mirrors
20 
21     Array(mirrors)
22   else
23     opts[:mirroring][:mirror]
24   end
25 end