From 7c8f4cdfba33058ee52a74ffaaa01f61efef383c Mon Sep 17 00:00:00 2001 From: Adam Micevski Date: Thu, 2 Feb 2017 21:21:04 +1100 Subject: [PATCH] Aliases `characters` to the `each_char` method In my opinion this method is no longer needed (`String#chars` and `String#each_char` have been implemented since at least 2.0) but it can be kept for backwards compatibility. --- lib/core/facets/string/characters.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/core/facets/string/characters.rb b/lib/core/facets/string/characters.rb index c41ba945..604126f9 100644 --- a/lib/core/facets/string/characters.rb +++ b/lib/core/facets/string/characters.rb @@ -4,10 +4,7 @@ class String # # "abc".characters.to_a #=> ["a","b","c"] # - # TODO: Probably should make this an enumerator. With #scan? - def characters - split(//) - end + alias :characters, :each_char end