Module: Grape::DSL::Callbacks::ClassMethods

Defined in:
lib/grape/dsl/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#after(&block) ⇒ Object

Execute the given block after the endpoint code has run.


43
44
45
# File 'lib/grape/dsl/callbacks.rb', line 43

def after(&block)
  namespace_stackable(:afters, block)
end

#after_validation(&block) ⇒ Object

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


38
39
40
# File 'lib/grape/dsl/callbacks.rb', line 38

def after_validation(&block)
  namespace_stackable(:after_validations, block)
end

#before(&block) ⇒ Object

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


26
27
28
# File 'lib/grape/dsl/callbacks.rb', line 26

def before(&block)
  namespace_stackable(:befores, block)
end

#before_validation(&block) ⇒ Object

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


32
33
34
# File 'lib/grape/dsl/callbacks.rb', line 32

def before_validation(&block)
  namespace_stackable(:before_validations, block)
end