Sha256: 8bd07ec7fb1a2da01c87629217cabdcf7674a06d514b17988856c0924624054b

Contents?: true

Size: 488 Bytes

Versions: 13

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

require 'luna_park/validators/dry'

module LunaPark
  module Extensions
    module Validatable
      module Dry
        def self.included(base)
          base.include Validatable
          base.extend  self
        end

        def validator(klass = nil, &block)
          return super unless block_given?

          klass = Class.new(Validators::Dry)
          klass.validation_schema(&block)
          super(klass)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
luna_park-0.13.2 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.13.1 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.13.0 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.12.1 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.12.0 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.7 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.6 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.5 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.4 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.3 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.2 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.1 lib/luna_park/extensions/validatable/dry.rb
luna_park-0.11.0 lib/luna_park/extensions/validatable/dry.rb