aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-05-11 12:56:53 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-05-11 12:56:53 -0500
commitb2e9d33515eb858507cfab8e15eb4a9e049a433a (patch)
treed37847e2103549840887dbab3a116d8890a4d26b /activesupport/lib
parent074359dfa8d9e16058de4bd6375b2438fef3de83 (diff)
downloadrails-b2e9d33515eb858507cfab8e15eb4a9e049a433a.tar.gz
rails-b2e9d33515eb858507cfab8e15eb4a9e049a433a.tar.bz2
rails-b2e9d33515eb858507cfab8e15eb4a9e049a433a.zip
improve String#first docs
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/string/access.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb
index 9bb0c597b2..baa5b84db6 100644
--- a/activesupport/lib/active_support/core_ext/string/access.rb
+++ b/activesupport/lib/active_support/core_ext/string/access.rb
@@ -64,10 +64,9 @@ class String
self[0..position]
end
- # Returns the first character of the string. If a limit is supplied,
- # returns a substring from the beginning of the string to the given
- # limit. If the given limit is greater than or equal to the string
- # length, returns self.
+ # Returns the first character. If a limit is supplied, returns a substring
+ # from the beginning of the string until it reaches the limit value. If the
+ # given limit is greater than or equal to the string length, returns self.
#
# str = "hello"
# str.first #=> "h"