diff options
author | Hitendra Singh <hitendrasingh1985@gmail.com> | 2013-09-20 11:07:41 +0530 |
---|---|---|
committer | Hitendra Singh <hitendrasingh1985@gmail.com> | 2013-09-20 12:49:42 +0530 |
commit | 5923ae63210e4ab639a82a7ff20b4fad73ff76bb (patch) | |
tree | 7ac636f682c3bae3de1e125e8d21c6d778f7d54d /activesupport/lib/active_support/multibyte | |
parent | 3b16d1f1a1ca4c091b3a84b5f6c0175d207c9058 (diff) | |
download | rails-5923ae63210e4ab639a82a7ff20b4fad73ff76bb.tar.gz rails-5923ae63210e4ab639a82a7ff20b4fad73ff76bb.tar.bz2 rails-5923ae63210e4ab639a82a7ff20b4fad73ff76bb.zip |
Drying up method_missing code
Diffstat (limited to 'activesupport/lib/active_support/multibyte')
-rw-r--r-- | activesupport/lib/active_support/multibyte/chars.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index a42e7f6542..3c0cf9f137 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -56,11 +56,10 @@ module ActiveSupport #:nodoc: # Forward all undefined methods to the wrapped string. def method_missing(method, *args, &block) + result = @wrapped_string.__send__(method, *args, &block) if method.to_s =~ /!$/ - result = @wrapped_string.__send__(method, *args, &block) self if result else - result = @wrapped_string.__send__(method, *args, &block) result.kind_of?(String) ? chars(result) : result end end |