るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.061秒)

別のキーワード

  1. module attr
  2. module public
  3. module private
  4. module protected
  5. module new

ライブラリ

検索結果

Warning.warn(message, category: nil) -> nil (25.0)

引数 message を標準エラー出力 $stderr に出力します。

...t[][ruby]{
module Warning
# 警告メッセージに category を表示し、message 末尾に !!! を追加する
def self.warn(message, category: nil)
super("#{category} warning : #{message.chomp}!!!\n")
end
end

warn("hoge", category: :deprecated)
# => deprecated warning : hoge!!!
//}...
...@param message 出力するオブジェクトを指定します。

@param category 警告のカテゴリを指定します。サポートされている category については Warning.[] を参照してください。

@see Kernel.#warn, Warning#warn...