Module: JSI::Base::Enumerable
Instance Method Summary collapse
-
#to_a(**kw) ⇒ Array
(also: #entries)
an Array containing each item in this JSI.
Instance Method Details
#to_a(**kw) ⇒ Array Also known as: entries
an Array containing each item in this JSI.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jsi/base/node.rb', line 11 def to_a(**kw) # TODO remove eventually (keyword argument compatibility) # discard when all supported ruby versions Enumerable#to_a delegate keywords to #each (3.0.1 breaks; 2.7.x warns) # https://bugs.ruby-lang.org/issues/18289 ary = [] each(**kw) do |e| ary << e end ary.freeze end |