Exception: LocalJumpError
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: 
          self,
           ::StandardError,::Exception | |
| Instance Chain: 
          self,
           ::StandardError,::Exception | |
| Inherits: | StandardError 
 | 
| Defined in: | proc.c, proc.c | 
Overview
Raised when Ruby can’t yield as requested.
A typical scenario is attempting to yield when no block is given:
def call_block
  yield 42
end
call_blockraises the exception:
LocalJumpError: no block given (yield)A more subtle example:
def get_me_a_return
  Proc.new { return 42 }
end
get_me_a_return.callraises the exception:
LocalJumpError: unexpected returnClass Attribute Summary
::Exception - Inherited
| .to_tty? | Returns  | 
Class Method Summary
::Exception - Inherited
| .exception | Returns an exception object of the same class as  | 
| .new | Returns a new exception object. | 
Instance Method Summary
- 
    
      #exit_value  ⇒ Object 
    
    Returns the exit value associated with this LocalJumpError.
- 
    
      #reason  ⇒ Symbol 
    
    The reason this block was terminated: :break,:redo,:retry,:next,:return, or:noreason.
::Exception - Inherited
| #== | Returns whether  | 
| #backtrace | Returns the backtrace (the list of code locations that led to the exception), as an array of strings. | 
| #backtrace_locations | Returns the backtrace (the list of code locations that led to the exception), as an array of  | 
| #cause | Returns the previous value of global variable  | 
| #detailed_message | Returns the message string with enhancements: | 
| #exception | Returns an exception object of the same class as  | 
| #full_message | Returns an enhanced message string: | 
| #inspect | Returns a string representation of  | 
| #message | Returns  | 
| #set_backtrace | Sets the backtrace value for  | 
| #to_s | Returns a string representation of  | 
Constructor Details
This class inherits a constructor from Exception
Instance Method Details
#exit_value ⇒ Object
Returns the exit value associated with this LocalJumpError.
# File 'proc.c', line 3452
static VALUE
localjump_xvalue(VALUE exc)
{
    return rb_iv_get(exc, "@exit_value");
}
  #reason ⇒ Symbol
The reason this block was terminated: :break, :redo, :retry, :next, :return, or :noreason.
# File 'proc.c', line 3466
static VALUE
localjump_reason(VALUE exc)
{
    return rb_iv_get(exc, "@reason");
}