Sha256: 9dc42b00f789765de111f3a82e5ad90502fb39e830be9c2a7d09e17e70237034
Contents?: true
Size: 570 Bytes
Versions: 6
Compression:
Stored size: 570 Bytes
Contents
# backtick_javascript: true 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
6 entries across 6 versions & 1 rubygems