Agree that `superset` is better name. Here is the actual use case: ```ruby Project.pluck(:id).contains?([1,2,3]) ``` Where `Project.pluck` returns an array of integers. To use set, I have to convert the array to a set. ```...cha1tanya (Prathamesh Sonpatki)
I woud like to propose `Array#contains?` which will check if the one array is part of another array. Implementation can be as follows: ``` def contains?(other) (other - self).empty? end ``` Some test cases: ``` [1, 2, 3]...cha1tanya (Prathamesh Sonpatki)
Currently, `Float::INFINITY` and `Float::NAN` error out when we try to convert them into JSON representation using `as_json` or `to_json` based on the following code from /ruby/ext/json/generator.c ~~~ c if (!allow_nan) { ...cha1tanya (Prathamesh Sonpatki)
Hash#compact and Hash#compact! were added in https://bugs.ruby-lang.org/issues/11818 but the Hash#compact! is different from Active Support. Please check following snippet: ~~~ ruby # Active Support >> hash = { a: true, b: false, c:...cha1tanya (Prathamesh Sonpatki)
Can we give both examples? I think the original example is a bit hard to understand due to two "..". In the first example we can show normal use and in second example, as you pointed out, how to resolve "..". Eregon (Benoit Daloze) wrot...cha1tanya (Prathamesh Sonpatki)