diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-20 23:25:33 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-20 23:25:33 +0530 |
commit | 2f0dca5ee081f22d20457150b92225958b6ef363 (patch) | |
tree | 4181ab8d7e67d9c39940430f5b8c328f2165e9b7 /railties/guides/source | |
parent | a48f8089aba974465ccd1f99506f04d1f60ac2d2 (diff) | |
download | rails-2f0dca5ee081f22d20457150b92225958b6ef363.tar.gz rails-2f0dca5ee081f22d20457150b92225958b6ef363.tar.bz2 rails-2f0dca5ee081f22d20457150b92225958b6ef363.zip |
document the Active Support extension - String#inquiry
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index b7f842a0d0..d4dda88937 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1266,6 +1266,15 @@ WARNING: The option +:separator+ can't be a regexp. NOTE: Defined in +active_support/core_ext/string/filters.rb+. +h4. +inquiry+ + +The <tt>String#inquiry</tt> method converts a string into a +StringInquirer+ object making equality checks prettier. + +<ruby> +"production".inquiry.production? # => true +"active".inquiry.inactive? # => false +</ruby> + h4. Key-based Interpolation In Ruby 1.9 the <tt>%</tt> string operator supports key-based interpolation, both formatted and unformatted: |