3 ms·
Is there no equivalent of php.net that explains this simple control structure?
by stef25 13y ago
Is there no equivalent of php.net that explains this simple control structure?
- masklinn 13y agoThe ruby community does not really believe in documentation, so you have to go for third-party sources[0] or books Also, it's not a simple control structure, Ruby's case/when does not do equality checks (via ==) it does match checks (via ===) so you can match integers to ranges: > (1..3) === 2 => true or instances to classes > String === "foo" => true But `===` is not commutative: > 2 === (1..3) => false and the matches can seem somewhat arbitrary: > (1..5) === (2..3) => false [0] http://www.techotopia.com/index.php/The_Ruby_case_Statement http://www.techotopia.com/index.php/The_Ruby_case_Statement
- k__ 13y ago> The ruby community does not really believe in documentation made my day, thanks.
- edoloughlin 13y agoThe lack of documentation, especially when you want to do something non-standard, made me give up on RoR a few years ago. I got sick of getting lost when looking at the source, which seemed to consist of 5-10 line methods with a call hierarchy that was usually over 10 methods deep.
- k__ 13y agoNever tried Ruby or RoR. But "I don't believe in ..." or "She doesn't believe in ..." is a running gag in my circle of friends. "He got rather bad teeth so he had to pay much money for getting them done..." - "Didn't his insurance cover this?" - "He doesn't believe in insurance!"
- deleted 13y ago[deleted]