Is there a way in Ruby to get an implicit case statement object?
case 2+2 when '2' puts '2' else puts "#{some_object}" end
Where 'some_object' will be the return value of any statement that was evaluated in case
No no. You will need to do something like:
some_object = 2+2 case some_object when '2' puts '2' else puts some_object end
or
case some_object = 2+2 when '2' puts '2' else puts some_object end
Source: https://habr.com/ru/post/1305482/More articles:How to create a status bar icon on the right side? (Android) - androidjava equivalent ruby || = syntax - javaRails Metaprogramming: how to add instance methods at runtime? - ruby | fooobar.comGet time in London - javaHow to dismantle iPhone application on projector - iphonehundreds of databases. - sql-serverHow to set up a performance test for Microsoft Sync Framework? - microsoft-sync-frameworkSql XML Column with Entity Framework - how to save minor spaces - sqlSoap WSDL with Null - nullOSGI on Google engine? - javaAll Articles