Sha256: 409687e96a690b2353db0bc73e7a60fa043e7136d1d318792f5117f88bc14797

Contents?: true

Size: 365 Bytes

Versions: 13

Compression:

Stored size: 365 Bytes

Contents

[
  Array,
  Complex,
  Enumerable,
  Float,
  Integer,
  Numeric,
  Range,
  Rational,
  Regexp,
  String,
  Symbol,
  Time
].each do |type|
  name = type.to_s.gsub(/(.)([A-Z])/,'\1_\2').downcase  # ActiveSupport/Inflector#underscore behaviour
  HashValidator.append_validator(HashValidator::Validator::SimpleValidator.new(name, lambda { |v| v.is_a?(type) }))
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hash_validator-1.1.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-1.0.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.8.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.7.1 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.7.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.6.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.5.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.4.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.3.0 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.2.7 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.2.6 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.2.5 lib/hash_validator/validators/simple_type_validators.rb
hash_validator-0.2.4 lib/hash_validator/validators/simple_type_validators.rb