Sha256: b6954fe95eade336a68e658bd1a055ff9ed15995896e3ae5b6e677658030fa81
Contents?: true
Size: 502 Bytes
Versions: 22
Compression:
Stored size: 502 Bytes
Contents
# frozen_string_literal: true module Grape module Middleware # This is a simple middleware for adding before and after filters # to Grape APIs. It is used like so: # # use Grape::Middleware::Filter, before: -> { do_something }, after: -> { do_something } class Filter < Base def before app.instance_eval(&options[:before]) if options[:before] end def after app.instance_eval(&options[:after]) if options[:after] end end end end
Version data entries
22 entries across 22 versions & 2 rubygems