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
945 946 947 948 949 950 951 952 953 954 955 956 957 |
# File 'lib/rubyhacks.rb', line 945 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
941 942 943 |
# File 'lib/rubyhacks.rb', line 941 def frame_start_goto STACK << [] end |