Skip to content

Commit

Permalink
Aliases characters to the each_char method
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Adam Micevski committed Feb 2, 2017
1 parent c58defb commit 7c8f4cd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/core/facets/string/characters.rb
Expand Up @@ -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

0 comments on commit 7c8f4cd

Please sign in to comment.