Sha256: 1888177d64eda52c7953710ef93ee43be91ae49e09a50a6e5756acfbf56272c3
Contents?: true
Size: 1.02 KB
Versions: 14
Compression:
Stored size: 1.02 KB
Contents
require 'dry/logic/predicates' require 'hanami/utils/class_attribute' module Hanami module Validations # Mixin to include when defining shared predicates # # @since 0.6.0 # # @see Hanami::Validations::ClassMethods#predicates # # @example Inline Predicate # require 'hanami/validations' # # module MySharedPredicates # include Hanami::Validations::Predicates # # predicate :foo? do |actual| # actual == 'foo' # end # end # # class MyValidator # include Hanami::Validations # predicates MySharedPredicates # # validations do # required(:name).filled(:foo?) # end # end module Predicates # @since 0.6.0 # @api private def self.included(base) base.class_eval do include Dry::Logic::Predicates include Utils::ClassAttribute class_attribute :messages class_attribute :messages_path end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems