別のキーワード
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- クラス/メソッドの定義 (11)
検索結果
-
Ruby用語集 (133.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...l#percent
: 0 オリジン
: zero-based
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始ま......し、切り替えて使うための
ツールの一つ。Linux、macOS などで動作する。
https://github.com/rbenv/rbenv
: RD(Ruby Document format)
Ruby スクリプト中に記述することを念頭に作られたドキュメントフォーマット。
: RDoc
Ruby スクリ......自身が属すクラスとは別に、オブジェクト固有の
クラスがあり、特異クラスと呼ばれる。
参照:Object#singleton_class
: 特異メソッド
: singleton method
オブジェクト固有のメソッド。
オブジェクトの特異クラスのインスタ... -
クラス/メソッドの定義 (113.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...クラス/メソッドの定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* d......は、最後に評価した式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。
===[a:singleton_class] 特異クラス定義
//emlist[例][ruby]{
obj = Object.new # obj = nil でも可
class << obj
def test
# ...
end
# ...
end
//}......い場合は nil を返します。
===[a:method] メソッド定義
//emlist[例][ruby]{
def fact(n)
if n == 1 then
1
else
n * fact(n-1)
end
end
//}
文法:
def メソッド名 ['(' [arg0 ['=' default0]] ... [',' '*' rest_args [, post ...]] [',' key1: [val1]] ... [',' '*... -
NEWS for Ruby 2
. 1 . 0 (79.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.0.0 以降の変更
=== 言語仕様の変更
* キーワード引数のデフォルト値......: Module#using, which activates refinements of the specified module only
in the current class or module definition.
* 追加: Module#singleton_class? レシーバーが特異クラスであれば true を返します。
レシーバーが通常のクラスやモジュールであれ......scrub, String#scrub! 不正なバイト列を検証して修正します。
古いバージョンのRubyと一緒に使いたいときは string-scrub gem を使います。
* Symbol
* 全てのシンボルは freeze されるようになりました
* pack/unpack (Array/String)... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (79.0)
-
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or plus minus ast slash hat sq period comma langl rangl eq tilde dollar at under lbrarbra lbra2rbra2 lbra3rbra3 dq colon ac backslash semicolon
...xxx # => 実行結果
慣用的に実行結果を示すために使われるコメントの書き方。
: #! ruby -Ks
shebang。d:spec/rubycmd#shebangを参照。
: # coding: utf-8
マジックコメント。d:spec/m17n#magic_comment を参照。
: "a is #{a}"
d:spec/literal#exp
//emlist{......法の一種。d:spec/literal#percent。ダブルクォート文字列で %Q!STRING! と同じ。
//emlist{
p %!nomad! #=> "nomad"
//}
: % ruby -e "puts 'Hello'"
コマンドラインへの入力を示す。rubyスクリプト上で入力を行うには `command` や system(command) などと......現の 1 回以上の繰り返し
===[a:minus] -
: 3 - 2
引き算。または類似のメソッド
: 3 * (-5)
単項 - (マイナス)。混乱を避けるため適宜()でくくるとよい。
: % ruby -w など コマンドラインの入力 -AAA
コマンドラインオプション
==...