mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
24 lines
381 B
Ruby
24 lines
381 B
Ruby
class ActionCallbacks
|
|
attr_reader :before_methods
|
|
attr_reader :after_methods
|
|
attr_reader :fails_methods
|
|
|
|
def initialize
|
|
@before_methods = []
|
|
@after_methods = []
|
|
@fails_methods = []
|
|
end
|
|
|
|
def before(method)
|
|
@before_methods << method
|
|
end
|
|
|
|
def after(method)
|
|
@after_methods << method
|
|
end
|
|
|
|
def fails(method)
|
|
@fails_methods << method
|
|
end
|
|
end
|