aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-06-27 20:30:51 -0300
committerXavier Noria <fxn@hashref.com>2010-06-28 01:45:57 +0200
commit6cc29ab65f7efc460aee1e374f100f03f32713a9 (patch)
tree139308a1bf7ae928598833a7c58988aeb39f91ed /activesupport/lib/active_support
parentf61d923d284062b4e4864d81c603157020198d06 (diff)
downloadrails-6cc29ab65f7efc460aee1e374f100f03f32713a9.tar.gz
rails-6cc29ab65f7efc460aee1e374f100f03f32713a9.tar.bz2
rails-6cc29ab65f7efc460aee1e374f100f03f32713a9.zip
Implemented getbyte as an aliased method and RDoc added
Signed-off-by: Xavier Noria <fxn@hashref.com>
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/string/conversions.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/conversions.rb b/activesupport/lib/active_support/core_ext/string/conversions.rb
index 857ecfaa54..5b2cb6e331 100644
--- a/activesupport/lib/active_support/core_ext/string/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/string/conversions.rb
@@ -28,9 +28,8 @@ class String
self[0]
end unless method_defined?(:ord)
- def getbyte(index)
- self[index]
- end unless method_defined?(:getbyte)
+ # +getbyte+ backport from Ruby 1.9
+ alias_method :getbyte, :[] unless method_defined?(:getbyte)
# Form can be either :utc (default) or :local.
def to_time(form = :utc)