Module: GoTo
- Defined in:
- lib/rubyhacks.rb
Defined Under Namespace
Constant Summary collapse
- STACK =
[]
Instance Method Summary collapse
- #frame_end_goto ⇒ Object
- #frame_start_goto ⇒ Object
- #goto(label) ⇒ Object
- #label_goto(sym, &block) ⇒ Object
Instance Method Details
#frame_end_goto ⇒ Object
956 957 958 959 960 961 962 963 964 965 966 967 968 |
# File 'lib/rubyhacks.rb', line 956 def frame_end_goto frame = STACK.pop idx = 0 begin for i in (idx...frame.size) frame[i].block.call if frame[i].block end rescue Goto => g idx = frame.index(g.label) retry end end |
#frame_start_goto ⇒ Object
952 953 954 |
# File 'lib/rubyhacks.rb', line 952 def frame_start_goto STACK << [] end |