From 6cc29ab65f7efc460aee1e374f100f03f32713a9 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 27 Jun 2010 20:30:51 -0300 Subject: Implemented getbyte as an aliased method and RDoc added Signed-off-by: Xavier Noria --- activesupport/lib/active_support/core_ext/string/conversions.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support') 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) -- cgit v1.2.3