Sha256: 02adc97f2ef62952812e3399e9b9f3fbb6b749d6397e26c3c98cbca863e94aa1

Contents?: true

Size: 516 Bytes

Versions: 16

Compression:

Stored size: 516 Bytes

Contents

module Natives
  class Catalog
    class Validator
      def ensure_valid_catalog_groups(hash)
        unless hash.kind_of? Hash
          raise ArgumentError, 'catalog should be a Hash'
        end

        invalid_groups = hash.select {|key, value| !value.kind_of?(Hash) }
        unless invalid_groups.empty?
          group_names = invalid_groups.keys
          raise ArgumentError,
            "The following catalog group(s) should be a Hash: #{group_names.join(', ')}"
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
natives-0.6.2 lib/natives/catalog/validator.rb
natives-0.6.1 lib/natives/catalog/validator.rb
natives-0.6.0 lib/natives/catalog/validator.rb
natives-0.5.5 lib/natives/catalog/validator.rb
natives-0.5.4 lib/natives/catalog/validator.rb
natives-0.5.3 lib/natives/catalog/validator.rb
natives-0.5.2 lib/natives/catalog/validator.rb
natives-0.5.1 lib/natives/catalog/validator.rb
natives-0.5.0 lib/natives/catalog/validator.rb
natives-catalog-0.3.4 lib/natives/catalog/validator.rb
natives-catalog-0.3.3 lib/natives/catalog/validator.rb
natives-catalog-0.3.2 lib/natives/catalog/validator.rb
natives-catalog-0.3.1 lib/natives/catalog/validator.rb
natives-catalog-0.3.0 lib/natives/catalog/validator.rb
natives-catalog-0.2.1 lib/natives/catalog/validator.rb
natives-catalog-0.2.0 lib/natives/catalog/validator.rb