aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-04-18 00:05:09 +0200
committerXavier Noria <fxn@hashref.com>2010-04-19 05:04:18 -0700
commit0f0b40d3b6ff8598624574beab92e4ac87481c1c (patch)
tree64d3da2644dc80160cb534085a5d6a2345142681
parent9428473f9de014e993152fe08277047db0f21848 (diff)
downloadrails-0f0b40d3b6ff8598624574beab92e4ac87481c1c.tar.gz
rails-0f0b40d3b6ff8598624574beab92e4ac87481c1c.tar.bz2
rails-0f0b40d3b6ff8598624574beab92e4ac87481c1c.zip
revises the rdoc of String#ord
-rw-r--r--activesupport/lib/active_support/core_ext/string/conversions.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/conversions.rb b/activesupport/lib/active_support/core_ext/string/conversions.rb
index 52946f9037..d70f5d7241 100644
--- a/activesupport/lib/active_support/core_ext/string/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/string/conversions.rb
@@ -3,7 +3,11 @@ require 'active_support/core_ext/time/publicize_conversion_methods'
require 'active_support/core_ext/time/calculations'
class String
- # 'a'.ord == 'a'[0] for Ruby 1.9 forward compatibility.
+ # Returns the ASCII code of the first character of the string, assuming it belongs to ASCII.
+ #
+ # This method is defined for Ruby 1.9 forward compatibility on ASCII characters.
+ #
+ # See also <tt>ActiveSupport::Multibyte::Chars#ord</tt>.
def ord
self[0]
end unless method_defined?(:ord)