зеркало из https://github.com/github/ruby.git
* lib/date.rb (once): use Object#object_id instead of Symbol#to_i.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e67e71d36a
Коммит
fe7dae730f
|
@ -1,3 +1,7 @@
|
||||||
|
Mon May 12 22:23:01 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* lib/date.rb (once): use Object#object_id instead of Symbol#to_i.
|
||||||
|
|
||||||
Mon May 12 21:34:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon May 12 21:34:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* test/ruby/envutil.rb (rubybin): return expanded rubyexe instead of
|
* test/ruby/envutil.rb (rubybin): return expanded rubyexe instead of
|
||||||
|
|
|
@ -1104,10 +1104,10 @@ class Date
|
||||||
def once(*ids) # :nodoc: -- restricted
|
def once(*ids) # :nodoc: -- restricted
|
||||||
for id in ids
|
for id in ids
|
||||||
module_eval <<-"end;"
|
module_eval <<-"end;"
|
||||||
alias_method :__#{id.to_i}__, :#{id.to_s}
|
alias_method :__#{id.object_id}__, :#{id.to_s}
|
||||||
private :__#{id.to_i}__
|
private :__#{id.object_id}__
|
||||||
def #{id.to_s}(*args)
|
def #{id.to_s}(*args)
|
||||||
@__ca__[#{id.to_i}] ||= __#{id.to_i}__(*args)
|
@__ca__[#{id.object_id}] ||= __#{id.object_id}__(*args)
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче