# syntax switch

**URL:** <https://discuss.rubyonrails.org/t/syntax-switch/528>\
**Category:** rubyonrails-talk\
**Created:** [August 26, 2006, 1:51pm UTC](https://discuss.rubyonrails.org/t/syntax-switch/528 "2006-08-26T13:51:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Roelofs](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jason\_Roelofs](https://discuss.rubyonrails.org/u/Jason_Roelofs)\
**Post date:** [August 26, 2006, 1:51pm UTC](https://discuss.rubyonrails.org/t/syntax-switch/528/1 "2006-08-26T13:51:38Z")

</div>

Wrong words, though it’s quite easy to go look this kind of stuff up in any Ruby documentation (Pragmatic Ruby Guid comes to mind). Here’s the syntax:

```ruby
case expr
  [when expr [, expr]...[then]
    expr..]..

  [else
    expr..]
end

Jason

```
