Sha256: 2e484a0461e2a8ca5b06e95769c687060a507c2259d4c955c9339041889ce7bb

Contents?: true

Size: 916 Bytes

Versions: 3

Compression:

Stored size: 916 Bytes

Contents

module Crystal
  module Filters
    inherit Callbacks    
          
    module ClassMethods
      def before *args, &block
        opt = args.extract_options!
        if block       
          set_callback :action, :before, opt, &block
        else 
          args.each{|executor| set_callback :action, :before, executor, opt}        
        end
      end
      
      def around *args, &block
        opt = args.extract_options!
        if block       
          set_callback :action, :around, opt, &block
        else 
          args.each{|executor| set_callback :action, :around, executor, opt}        
        end
      end
      
      def after *args, &block
        opt = args.extract_options!
        if block       
          set_callback :action, :after, opt, &block
        else 
          args.each{|executor| set_callback :action, :after, executor, opt}        
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
crystal-0.0.13 lib/crystal/support/filters.rb
crystal-0.0.12 lib/crystal/support/filters.rb
crystal_ext-0.0.11 lib/crystal/support/filters.rb