Sha256: 71614c4b3cf34f8ea58e288710fb53101350c9ffcc6ad08470b684fa59fa2506

Contents?: true

Size: 598 Bytes

Versions: 18

Compression:

Stored size: 598 Bytes

Contents

# -*- encoding : utf-8 -*-
module Dao
  module Validations
    class Callback < ::Proc
      attr :options

      def initialize(options = {}, &block)
        @options = Map.for(options || {})
        super(&block)
      end

      def block
        self
      end

      class Chain
        def initialize
          @chain = []
        end

        def add(callback)
          @chain.push(callback)
        end

        def each(&block)
          @chain.each(&block)
        end

        def each_with_index(&block)
          @chain.each_with_index(&block)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dao-8.0.1 lib/dao/validations/callback.rb
dao-8.0.0 lib/dao/validations/callback.rb
dao-7.0.0 lib/dao/validations/callback.rb
dao-5.6.1 lib/dao/validations/callback.rb
dao-5.5.2 lib/dao/validations/callback.rb
dao-5.5.1 lib/dao/validations/callback.rb
dao-5.5.0 lib/dao/validations/callback.rb
dao-5.4.0 lib/dao/validations/callback.rb
dao-5.3.3 lib/dao/validations/callback.rb
dao-5.3.2 lib/dao/validations/callback.rb
dao-5.3.0 lib/dao/validations/callback.rb
dao-5.2.1 lib/dao/validations/callback.rb
dao-5.1.2 lib/dao/validations/callback.rb
dao-5.1.1 lib/dao/validations/callback.rb
dao-5.0.0 lib/dao/validations/callback.rb
dao-4.6.4 lib/dao/validations/callback.rb
dao-4.4.4 lib/dao/validations/callback.rb
dao-4.4.2 lib/dao/validations/callback.rb