Skip to content
Permalink
Browse files
Implement String.new encoding optional argument
  • Loading branch information
tak1n committed Jan 21, 2016
1 parent 57d8550 commit 2fa07b5a513fd47612efa469893926efebbab26c
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 2fa07b5

Please sign in to comment.