fork download
  1. x = (hoge rescue "default")
  2. puts x # => "default"
  3.  
  4. # puts hoge # NameError ここではhogeは定義はされていない
  5.  
  6. hoge = "some_value"
  7. x = (hoge rescue "default")
  8. puts x # => "some_value"
  9.  
Success #stdin #stdout 0s 4760KB
stdin
Standard input is empty
stdout
default
some_value