* lib/observer.rb: [DOC] syntax improvement in example by @chastell

[Fixes GH-400] https://github.com/ruby/ruby/pull/400


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
zzak 2013-09-26 13:09:13 +00:00
parent 017a975ec2
commit 327cd07708
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
Thu Sep 26 22:08:11 2013 Zachary Scott <e@zzak.io>
* lib/observer.rb: [DOC] syntax improvement in example by @chastell
[Fixes GH-400] https://github.com/ruby/ruby/pull/400
Thu Sep 26 22:03:15 2013 Zachary Scott <e@zzak.io> Thu Sep 26 22:03:15 2013 Zachary Scott <e@zzak.io>
* ext/digest/digest.c: [DOC] typo in overview by @chastell * ext/digest/digest.c: [DOC] typo in overview by @chastell

View File

@ -49,13 +49,13 @@
# end # end
# #
# def run # def run
# lastPrice = nil # last_price = nil
# loop do # loop do
# price = Price.fetch(@symbol) # price = Price.fetch(@symbol)
# print "Current price: #{price}\n" # print "Current price: #{price}\n"
# if price != lastPrice # if price != last_price
# changed # notify observers # changed # notify observers
# lastPrice = price # last_price = price
# notify_observers(Time.now, price) # notify_observers(Time.now, price)
# end # end
# sleep 1 # sleep 1
@ -64,7 +64,7 @@
# end # end
# #
# class Price ### A mock class to fetch a stock price (60 - 140). # class Price ### A mock class to fetch a stock price (60 - 140).
# def Price.fetch(symbol) # def self.fetch(symbol)
# 60 + rand(80) # 60 + rand(80)
# end # end
# end # end