mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (is_defined): defined?(Foo::Baz) should check constants
only, no methods. * eval.c (is_defined): should not dump core on defined?(a::b) where a is not a class nor a module. * object.c (Init_Object): remove dup and clone from TrueClass, FalseClass, and NilClass. * array.c (rb_ary_fill): Array#fill takes block to get the value to fill. * string.c (rb_str_to_i): to_i(0) auto-detects base radix. * array.c (rb_ary_initialize): fill by the block evaluation value if block is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ae6afaaedb
commit
4f38c453b4
14 changed files with 110 additions and 28 deletions
|
|
@ -30,7 +30,7 @@
|
|||
# that the Singleton pattern is properly inherited.
|
||||
#
|
||||
# In addition Klass is provided with the class methods
|
||||
# * Klass.instance() - returning ``the instance''
|
||||
# * Klass.instance() - returning ``the instance''
|
||||
# * Klass._load(str) - returning ``the instance''
|
||||
# * Klass._wait() - a hook method putting a second (or n-th)
|
||||
# thread calling Klass.instance on a waiting loop if the first call
|
||||
|
|
@ -43,6 +43,7 @@
|
|||
# _dump(depth) and _load(str) method allows the (partial) resurrection
|
||||
# of a previous state of ``the instance'' - see third example.
|
||||
#
|
||||
|
||||
module Singleton
|
||||
def Singleton.included (klass)
|
||||
# should this be checked?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue