Browse files

revises the rdoc of String#ord

  • Loading branch information...
1 parent ea3fa4e commit 7f25e2378358fbb09011ad932a6709831a7e59d2 @fxn fxn committed Apr 18, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 activesupport/lib/active_support/core_ext/string/conversions.rb
View
6 activesupport/lib/active_support/core_ext/string/conversions.rb
@@ -3,7 +3,11 @@
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)

0 comments on commit 7f25e23

Please sign in to comment.