Module: Shrine::Plugins::Hooks::InstanceMethods

Defined in:
lib/shrine/plugins/hooks.rb

Instance Method Summary collapse

Instance Method Details

#after_deleteObject



83
84
# File 'lib/shrine/plugins/hooks.rb', line 83

def after_delete(*)
end

#after_processObject



45
46
# File 'lib/shrine/plugins/hooks.rb', line 45

def after_process(*)
end

#after_storeObject



64
65
# File 'lib/shrine/plugins/hooks.rb', line 64

def after_store(*)
end

#after_uploadObject



25
26
# File 'lib/shrine/plugins/hooks.rb', line 25

def after_upload(*)
end

#around_delete(*args) ⇒ Object



76
77
78
# File 'lib/shrine/plugins/hooks.rb', line 76

def around_delete(*args)
  yield
end

#around_process(*args) ⇒ Object



38
39
40
# File 'lib/shrine/plugins/hooks.rb', line 38

def around_process(*args)
  yield
end

#around_store(*args) ⇒ Object



57
58
59
# File 'lib/shrine/plugins/hooks.rb', line 57

def around_store(*args)
  yield
end

#around_upload(*args) ⇒ Object



18
19
20
# File 'lib/shrine/plugins/hooks.rb', line 18

def around_upload(*args)
  yield
end

#before_deleteObject



80
81
# File 'lib/shrine/plugins/hooks.rb', line 80

def before_delete(*)
end

#before_processObject



42
43
# File 'lib/shrine/plugins/hooks.rb', line 42

def before_process(*)
end

#before_storeObject



61
62
# File 'lib/shrine/plugins/hooks.rb', line 61

def before_store(*)
end

#before_uploadObject



22
23
# File 'lib/shrine/plugins/hooks.rb', line 22

def before_upload(*)
end

#delete(io, context = {}) ⇒ Object



68
69
70
71
72
73
74
# File 'lib/shrine/plugins/hooks.rb', line 68

def delete(io, context = {})
  result = nil
  before_delete(io, context)
  around_delete(io, context) { result = super }
  after_delete(io, context)
  result
end

#store(io, context = {}) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/shrine/plugins/hooks.rb', line 49

def store(io, context = {})
  result = nil
  before_store(io, context)
  around_store(io, context) { result = super }
  after_store(io, context)
  result
end

#upload(io, context = {}) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/shrine/plugins/hooks.rb', line 10

def upload(io, context = {})
  result = nil
  before_upload(io, context)
  around_upload(io, context) { result = super }
  after_upload(io, context)
  result
end