1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 63112: [Backport #14818]

Remove outdated example from Numeric documentation

	Since 2.5, Numeric instances can be cloned and duplicated.

	[Fix GH-1850]

	From: Miguel Landaeta <miguel@miguel.cc>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@64127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2018-07-30 14:00:13 +00:00
parent b6ab48d8b1
commit 08c74b7593
2 changed files with 5 additions and 4 deletions

View file

@ -5179,10 +5179,11 @@ int_truncate(int argc, VALUE* argv, VALUE num)
* puts 1.object_id == a.object_id #=> true
*
* There can only ever be one instance of the integer +1+, for example. Ruby ensures this
* by preventing instantiation and duplication.
* by preventing instantiation. If duplication is attempted, the same instance is returned.
*
* Integer.new(1) #=> NoMethodError: undefined method `new' for Integer:Class
* 1.dup #=> TypeError: can't dup Integer
* Integer.new(1) #=> NoMethodError: undefined method `new' for Integer:Class
* 1.dup #=> 1
* 1.object_id == 1.dup.object_id #=> true
*
* For this reason, Numeric should be used when defining other numeric classes.
*

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.4.5"
#define RUBY_RELEASE_DATE "2018-07-30"
#define RUBY_PATCHLEVEL 307
#define RUBY_PATCHLEVEL 308
#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 7