module Grape::DSL::Callbacks::ClassMethods

Public Instance Methods

after(&block) click to toggle source

Execute the given block after the endpoint code has run.

# File lib/grape/dsl/callbacks.rb, line 43
def after(&block)
  namespace_stackable(:afters, block)
end
after_validation(&block) click to toggle source

Execute the given block after validations and coercions, but before any endpoint code.

# File lib/grape/dsl/callbacks.rb, line 38
def after_validation(&block)
  namespace_stackable(:after_validations, block)
end
before(&block) click to toggle source

Execute the given block before validation, coercion, or any endpoint code is executed.

# File lib/grape/dsl/callbacks.rb, line 26
def before(&block)
  namespace_stackable(:befores, block)
end
before_validation(&block) click to toggle source

Execute the given block after `before`, but prior to validation or coercion.

# File lib/grape/dsl/callbacks.rb, line 32
def before_validation(&block)
  namespace_stackable(:before_validations, block)
end