summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 13:09:13 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 13:09:13 +0000
commit327cd07708918f52fa545a51aa47221cd9237945 (patch)
tree7dfd480ae79ef9d869ad28f226d52145f3d50e9b
parent017a975ec26b7267920cd87abcd175dcb8096d66 (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--lib/observer.rb8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d6a3f62..9c0ee76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* ext/digest/digest.c: [DOC] typo in overview by @chastell
diff --git a/lib/observer.rb b/lib/observer.rb
index 208d8ed..3756794 100644
--- a/lib/observer.rb
+++ b/lib/observer.rb
@@ -49,13 +49,13 @@
# end
#
# def run
-# lastPrice = nil
+# last_price = nil
# loop do
# price = Price.fetch(@symbol)
# print "Current price: #{price}\n"
-# if price != lastPrice
+# if price != last_price
# changed # notify observers
-# lastPrice = price
+# last_price = price
# notify_observers(Time.now, price)
# end
# sleep 1
@@ -64,7 +64,7 @@
# end
#
# class Price ### A mock class to fetch a stock price (60 - 140).
-# def Price.fetch(symbol)
+# def self.fetch(symbol)
# 60 + rand(80)
# end
# end