Sha256: ccf0ead74bd6505d220fe0cec960fd967742f2a56f5410639e2b8d32fed3fbba
Contents?: true
Size: 446 Bytes
Versions: 5
Compression:
Stored size: 446 Bytes
Contents
module Judge class ValidatorCollection include Enumerable attr_reader :validators def initialize(object, method) amvs = object.class.validators_on(method) @validators = amvs.map { |amv| Judge::Validator.new(object, method, amv) } end def each(&block) validators.each do |v| block.call(v) end end def to_json validators.map { |v| v.to_hash }.to_json end end end
Version data entries
5 entries across 5 versions & 1 rubygems