aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorHitendra Singh <hitendrasingh1985@gmail.com>2013-09-20 11:07:41 +0530
committerHitendra Singh <hitendrasingh1985@gmail.com>2013-09-20 12:49:42 +0530
commit5923ae63210e4ab639a82a7ff20b4fad73ff76bb (patch)
tree7ac636f682c3bae3de1e125e8d21c6d778f7d54d /activesupport
parent3b16d1f1a1ca4c091b3a84b5f6c0175d207c9058 (diff)
downloadrails-5923ae63210e4ab639a82a7ff20b4fad73ff76bb.tar.gz
rails-5923ae63210e4ab639a82a7ff20b4fad73ff76bb.tar.bz2
rails-5923ae63210e4ab639a82a7ff20b4fad73ff76bb.zip
Drying up method_missing code
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/multibyte/chars.rb3
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