def to_native(query, ctx)
      return 0 if query.nil?
      flat_query = [query].flatten
      flat_query.inject(0) do |val, o|
        case o
        when Symbol
          v = @kv_map[o]
          raise ArgumentError, "invalid bitmask value, #{o.inspect}" unless v
          val |= v
        when Integer
          val |= o
        when ->(obj) { obj.respond_to?(:to_int) }
          val |= o.to_int
        else
          raise ArgumentError, "invalid bitmask value, #{o.inspect}"
        end
      end
    end
def to_native(query, ctx)
      return 0 if query.nil?
      flat_query = [query].flatten
      flat_query.inject(0) do |val, o|
        case o
        when Symbol
          v = @kv_map[o]
          raise ArgumentError, "invalid bitmask value, #{o.inspect}" unless v
          val |= v
        when Integer
          val |= o
        when ->(obj) { obj.respond_to?(:to_int) }
          val |= o.to_int
        else
          raise ArgumentError, "invalid bitmask value, #{o.inspect}"
        end
      end
    end
Get the native value of a bitmask
 @overload to_native(query, ctx)
  @param [Symbol, Integer, #to_int] query
  @param ctx unused
  @return [Integer] value of a bitmask
 @overload to_native(query, ctx)
  @param [Array<Symbol, Integer, #to_int>] query
  @param ctx unused
  @return [Integer] value of a bitmask