summaryrefslogtreecommitdiff
path: root/lib/observer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/observer.rb')
-rw-r--r--lib/observer.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/observer.rb b/lib/observer.rb
index 208d8ed6ed6..3756794952c 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