Class: HatebuWatcher::Base
- Inherits:
-
Object
- Object
- HatebuWatcher::Base
- Defined in:
- lib/hatebu_watcher/base.rb
Instance Method Summary collapse
-
#initialize(url, interval) ⇒ Base
constructor
A new instance of Base.
- #watch ⇒ Object
Constructor Details
#initialize(url, interval) ⇒ Base
Returns a new instance of Base.
3 4 5 6 7 8 |
# File 'lib/hatebu_watcher/base.rb', line 3 def initialize(url, interval) @interval = interval @counter = Counter.new(url) @counter.add_observer(Observers::CounterObserver.new) end |
Instance Method Details
#watch ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/hatebu_watcher/base.rb', line 10 def watch loop do puts @counter.reload.count sleep @interval end end |