# File lib/ruote/util/filter.rb, line 435
    def of_type?(value, types)

      types = types.is_a?(Array) ? types : split_type(types)

      types.inject(false) do |valid, type|

        valid ||= case type
          when 'null', 'nil'
            value == nil
          when 'string'
            value.class == String
          when 'number'
            NUMBER_CLASSES.include?(value.class)
          when /^(array|object|hash)<(.*)>$/
            children_of_type?(value, $~[2])
          when 'object', 'hash'
            value.class == Hash
          when 'array'
            value.class == Array
          when 'boolean', 'bool'
            BOOLEAN_CLASSES.include?(value.class)
          else
            raise ArgumentError.new("unknown type '#{type}'")
        end
      end
    end