提交 0f0b40d3 编写于 作者: X Xavier Noria

revises the rdoc of String#ord

上级 9428473f
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册