種類
- 文書 (58)
- インスタンスメソッド (12)
- 特異メソッド (9)
ライブラリ
- ビルトイン (21)
クラス
- Module (12)
モジュール
- Warning (9)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) -
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) - Ruby用語集 (12)
-
const
_ missing (12)
検索結果
先頭5件
-
Warning
. warn(message) -> nil (21137.0) -
引数 message を標準エラー出力 $stderr に出力します。
...ある $stderr への出力ができます。
//emlist[][ruby]{
warn "hoge" # => hoge
module Warning
# 警告メッセージの末尾に !!! を追加する
def self.warn(message)
super(message.chomp + "!!!\n")
end
end
warn "hoge" # => hoge!!!
//}
@param message 出力するオブジ......ェクトを指定します。
@param category 警告のカテゴリを指定します。サポートされている category については Warning.[] を参照してください。
@see Kernel.#warn, Warning#warn... -
Warning
. warn(message , category: nil) -> nil (21131.0) -
引数 message を標準エラー出力 $stderr に出力します。
...emlist[][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... -
Module
# const _ missing(name) (21006.0) -
定義されていない定数を参照したときに Ruby インタプリタが このメソッドを呼びます。
...mbol
@raise NameError このメソッドを呼び出した場合、デフォルトで発生する例外
//emlist[例][ruby]{
class Foo
def Foo.const_missing(id)
warn "undefined constant #{id.inspect}"
end
Bar
end
Foo::Bar
# => undefined constant :Bar
# undefined constant :Bar
//}... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (420.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...いう振
るまい(C の do ... while 構文と同じ)をしていませんでした。
((<ruby-list:34618>))
: ((<"rescue/ensure on class/module"|クラス/メソッドの定義/クラス定義>)) [compat]
メソッド定義のほかにもクラス定義やモジュール定義にもresc......クラスと発生した例外オブジェクトの比較 [ruby] [change]
発生した例外 $! と rescue 節の例外クラスとは ((<Module#===|Module/===>))
を使って比較するようになりました。
以前は kind_of? による比較なので基本的な動作に変わりは......た。
# # derived from sample/test.rb
# a = *[]; p a # special case
# def f; yield; end; f {|a| p a} # add (warning)
# def r; return; end; a = r(); p a
# a = nil; p a
# def f; yield nil; end; f {|a| p a}
# def r; return nil; end; a = r(); p a
#... -
NEWS for Ruby 3
. 0 . 0 (102.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ください。
== 言語仕様の変更
* Keyword arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no lo......pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)......stead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a RuntimeError is now raised (previously,
it only issued a warning in ve... -
Ruby用語集 (90.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...参照:rdoc
: refinement
既存のクラスやモジュールを特定のスコープでのみ改変する仕組み。
参照:Module#refine、Module#using、main.using
: Ruby Central
Rubyのサポートと世界の Ruby コミュニティーの支援を専門とする非営利組織......ェクトの振る舞いを規定するもの。
Ruby ではクラスも Class クラスのオブジェクトである。
Class クラスは Module クラスの下位クラスであり、モジュールとしての性質も
おおむね受け継いでいる。ただし、一部のメソッド......出すかどうかを指定するもの(warn_indent)
がある。
参照:d:spec/m17n#magic_comment
: ミックスイン
: mix-in
モジュールやクラスに対し、他のモジュールの機能を組み込むこと。
参照:Module#include
: 未定義化(メソッドの)... -
NEWS for Ruby 2
. 0 . 0 (60.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...化された絶対パ スで返します。
* 追加: Kernel.#caller_locations フレーム情報の配列を返します
* 拡張: Kernel.#warn Kernel.#puts のように複数の引数を受け付けるようになりました
* 拡張: Kernel.#caller 第2引数で取得するスタッ......* Module
* 追加: Module#prepend 指定したモジュールを self の継承チェインの先頭に
「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。
* 追加: Module.prepended, Module.prepend_features は Module.inc......luded と Module.append_features に似ています
* 追加(実験的): Module#refine, スコープを限定してクラスやモジュールを拡張します。
* 拡張: Module#define_method は UnboundMethod を受け付けるようになりました
* 拡張: Module#const_get 修... -
NEWS for Ruby 2
. 5 . 0 (60.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...た 14123
* Kernel.#warn :uplevel というキーワード引数を追加しました 12882
* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び出します 14142
* Module
* Module#attr, Module#attr_accessor, Module#attr_reader, Module#attr_writer はパブリ......ックメソッドになりました 14132
* Module#define_method, Module#alias_method, Module#undef_method, Module#remove_method はパブリックメソッドになりました 14133
* Numeric
* Numeric#step は > で0と比較できない引数が与えられたときcoerce内部で発... -
NEWS for Ruby 2
. 4 . 0 (24.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...a#values_at は named captures をサポートするようになりました 9179
* Module
* Module#refine 引数としてモジュールを許可するようになりました 12534
* Module.used_modules を追加 7418
* Numeric
* Numeric#finite?, Numeric#infinite? を追加 12039......n_exception を追加 6647
* TracePoint
* TracePoint#callee_id を追加 12747
* Warning
* Warningという名前のモジュールを導入しました。
デフォルトでは Warning.#warn という特異メソッドだけ定義されているモジュールです。
サ...