Class: Opal::Rewriters::BlockToIter

Inherits:
Base
  • Object
show all
Defined in:
opal/lib/opal/rewriters/block_to_iter.rb

Instance Method Summary collapse

Methods inherited from Base

#append_to_body, #prepend_to_body, #s, s

Instance Method Details

#on_block(node) ⇒ Object



7
8
9
10
11
12
13
14
# File 'opal/lib/opal/rewriters/block_to_iter.rb', line 7

def on_block(node)
  recvr, args, body = *super
  iter_node = s(:iter, args, body)
  recvr.updated(
    nil,
    recvr.children + [iter_node]
  )
end