Sha256: ccf3053d61508fbdc887d684b77afadc70128040620f209fd0374f1ebaa3c5bf
Contents?: true
Size: 541 Bytes
Versions: 10
Compression:
Stored size: 541 Bytes
Contents
class Enumerator class Yielder def initialize(&block) @block = block # rubocop:disable Lint/Void self # rubocop:enable Lint/Void end def yield(*values) %x{ var value = Opal.yieldX(#{@block}, values); if (value && value.$thrower_type == "break") { throw value; } return value; } end def <<(value) self.yield(value) self end def to_proc proc do |*values| self.yield(*values) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems