るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.054秒)
トップページ > クエリ:new[x] > クエリ:now[x] > 種類:モジュール[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

検索結果

Observable (25.0)

Observer パターンを提供するモジュールです。

...\n"
if price != last_price
changed # notify observers
last_price = price
notify_observers(Time.now, price)
end
sleep 1
end
end
end

class Price ### A mock class to fetch a stock price (60 - 140).
def se...
...price > @limit
print "+++ #{time.to_s}: Price above #@limit: #{price}\n"
end
end
end

ticker = Ticker.new("MSFT")
WarnLow.new(ticker, 80)
WarnHigh.new(ticker, 120)
ticker.run

# => Current price: 126
# => +++ 2017-11-02 12:09:36 +0900: Price above 120: 126
# => Curr...