Skip to content
Permalink
Browse files
Merge pull request #3583 from rubinius/implement_string_new_encoding
Implement String.new encoding optional argument
  • Loading branch information
tak1n committed Jan 21, 2016
2 parents f1d36c7 + 2fa07b5 commit f5d9420be1ac2d195e5ae43981dad553802396ab
Showing with 2 additions and 2 deletions.
  1. +2 −1 kernel/common/string.rb
  2. +0 −1 spec/tags/ruby/core/string/new_tags.txt
@@ -42,8 +42,9 @@ def clone
alias_method :dup, :clone
end

def initialize(arg = undefined)
def initialize(arg = undefined, encoding: nil)
replace arg unless undefined.equal?(arg)
self.force_encoding(encoding) if encoding
self
end

This file was deleted.

0 comments on commit f5d9420

Please sign in to comment.