mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* observer.rb: raise NoMethodError instead of NameError. [ruby-dev:18788]
* ostruct.rb: ditto. fix a bug in inspect which called String#+ with Symbol. [ruby-dev:18788] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e66faf84ce
commit
c0e98a1384
3 changed files with 11 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Fri Nov 15 07:40:08 2002 NAKAMURA Hiroshi <nakahiro@sarion.co.jp>
|
||||||
|
|
||||||
|
* observer.rb: raise NoMethodError instead of NameError.
|
||||||
|
[ruby-dev:18788]
|
||||||
|
|
||||||
|
* ostruct.rb: ditto. fix a bug in inspect which called String#+ with
|
||||||
|
Symbol. [ruby-dev:18788]
|
||||||
|
|
||||||
Thu Nov 14 22:40:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Thu Nov 14 22:40:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* configure.in (LIBRUBY_A): append -static. [ruby-dev:18689]
|
* configure.in (LIBRUBY_A): append -static. [ruby-dev:18689]
|
||||||
|
|
|
@ -6,7 +6,7 @@ module Observable
|
||||||
def add_observer(observer)
|
def add_observer(observer)
|
||||||
@observer_peers = [] unless defined? @observer_peers
|
@observer_peers = [] unless defined? @observer_peers
|
||||||
unless observer.respond_to? :update
|
unless observer.respond_to? :update
|
||||||
raise NameError, "observer needs to respond to `update'"
|
raise NoMethodError, "observer needs to respond to `update'"
|
||||||
end
|
end
|
||||||
@observer_peers.push observer
|
@observer_peers.push observer
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,7 +30,7 @@ class OpenStruct
|
||||||
elsif args.length == 0
|
elsif args.length == 0
|
||||||
@table[mid]
|
@table[mid]
|
||||||
else
|
else
|
||||||
raise NameError, "undefined method `#{mname}'", caller(1)
|
raise NoMethodError, "undefined method `#{mname}'", caller(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class OpenStruct
|
||||||
str = "<#{self.class}"
|
str = "<#{self.class}"
|
||||||
for k,v in @table
|
for k,v in @table
|
||||||
str += " "
|
str += " "
|
||||||
str += k
|
str += k.to_s
|
||||||
str += "="
|
str += "="
|
||||||
str += v.inspect
|
str += v.inspect
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue