Skip to content

Commit

Permalink
Merge pull request #3583 from rubinius/implement_string_new_encoding
Browse files Browse the repository at this point in the history
Implement String.new encoding optional argument
  • Loading branch information
tak1n committed Jan 21, 2016
2 parents f1d36c7 + 2fa07b5 commit f5d9420
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kernel/common/string.rb
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion spec/tags/ruby/core/string/new_tags.txt

This file was deleted.

0 comments on commit f5d9420

Please sign in to comment.