Rails' StringInquirer

A recent commit to Rails. When the last method of a method chain ends with a question mark, the entire chain reads like a question.

1
2
3
4
5
$> Rails.env == 'production'
$> # => true

$> Rails.env.production?
$> # => true

The latter is much better. I love these smart little additions. Any string wrapped up in a StringInquirer has this functionality.

Comments

Have something to say?
Please rewrite the image text Are You Human? Hint: Are You Human? Formatting Tips

or

© 2008 Ryan Heath | Site Management A Ruby on Rails production.

Get in Touch