種類
- インスタンスメソッド (18)
- 特異メソッド (2)
ライブラリ
- ビルトイン (20)
クラス
-
Enumerator
:: Lazy (8) -
Process
:: Status (1) -
RubyVM
:: InstructionSequence (4) - String (7)
キーワード
-
absolute
_ path (1) - chunk (2)
- compile (1)
- gsub (4)
- new (1)
- path (1)
-
slice
_ after (2) -
slice
_ before (3) -
slice
_ when (1) - sub (3)
検索結果
先頭5件
-
Process
:: Status # >>(num) -> Integer (87367.0) -
self.to_i >> num と同じです。
self.to_i >> num と同じです。
@param num 整数を指定します。
fork { exit 99 } #=> 26563
Process.wait #=> 26563
$?.to_i #=> 25344
$? >> 8 #=> 99 -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (42319.0) -
self が表す命令シーケンスの絶対パスを返します。
self が表す命令シーケンスの絶対パスを返します。
self を文字列から作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.... -
RubyVM
:: InstructionSequence # path -> String (42319.0) -
self が表す命令シーケンスの相対パスを返します。
self が表す命令シーケンスの相対パスを返します。
self の作成時に指定した文字列を返します。self を文字列から作成していた
場合は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compi... -
Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy (33919.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>
1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]], [false, [4, 5... -
Enumerator
:: Lazy # slice _ before(initial _ state) {|elt , state| bool } -> Enumerator :: Lazy (33919.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6... -
Enumerator
:: Lazy # slice _ after(pattern) -> Enumerator :: Lazy (33619.0) -
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>
1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).force
# => [[1, 2, 3], [4, 5, 6], [... -
Enumerator
:: Lazy # slice _ before(pattern) -> Enumerator :: Lazy (33619.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6... -
Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy (33319.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>
1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]], [false, [4, 5... -
Enumerator
:: Lazy # slice _ after {|elt| bool } -> Enumerator :: Lazy (33319.0) -
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>
1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).force
# => [[1, 2, 3], [4, 5, 6], [... -
Enumerator
:: Lazy # slice _ before {|elt| bool } -> Enumerator :: Lazy (33319.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6... -
Enumerator
:: Lazy # slice _ when {|elt _ before , elt _ after| bool } -> Enumerator :: Lazy (33319.0) -
Enumerable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007fce84118348>:each>>
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }.take(5).force
# => [[1, 2]... -
String
# gsub(pattern) -> Enumerator (24610.0) -
文字列中で pattern にマッチした部分を順番にブロックに渡し、 その実行結果で置き換えた文字列を生成して返します。 ブロックなしの場合と違い、ブロックの中からは 組み込み変数 $1, $2, $3, ... を問題なく参照できます。
文字列中で pattern にマッチした部分を順番にブロックに渡し、
その実行結果で置き換えた文字列を生成して返します。
ブロックなしの場合と違い、ブロックの中からは
組み込み変数 $1, $2, $3, ... を問題なく参照できます。
@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@return 新しい文字列
//emlist[例][ruby]{
p 'abcabc'.gsub(/[bc]/) {|s| s.upcase } #=> "aBCaBC"
... -
String
# gsub(pattern) {|matched| . . . . } -> String (24610.0) -
文字列中で pattern にマッチした部分を順番にブロックに渡し、 その実行結果で置き換えた文字列を生成して返します。 ブロックなしの場合と違い、ブロックの中からは 組み込み変数 $1, $2, $3, ... を問題なく参照できます。
文字列中で pattern にマッチした部分を順番にブロックに渡し、
その実行結果で置き換えた文字列を生成して返します。
ブロックなしの場合と違い、ブロックの中からは
組み込み変数 $1, $2, $3, ... を問題なく参照できます。
@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@return 新しい文字列
//emlist[例][ruby]{
p 'abcabc'.gsub(/[bc]/) {|s| s.upcase } #=> "aBCaBC"
... -
String
# sub(pattern) {|matched| . . . . } -> String (24607.0) -
文字列中で pattern にマッチした最初の部分をブロックに渡し、 その評価結果で置き換えた新しい文字列を返します。 ブロックなしの sub と違い、ブロックの中からは 組み込み変数 $1, $2, $3, ... を問題なく参照できます。
文字列中で pattern にマッチした最初の部分をブロックに渡し、
その評価結果で置き換えた新しい文字列を返します。
ブロックなしの sub と違い、ブロックの中からは
組み込み変数 $1, $2, $3, ... を問題なく参照できます。
@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
//emlist[例][ruby]{
p 'abcabc'.sub(/b/) {|s| s.upcase } #=> "aBcabc"
p 'abcabc'.sub(/b... -
String
# gsub(pattern , replace) -> String (24355.0) -
文字列中で pattern にマッチする部分全てを 文字列 replace で置き換えた文字列を生成して返します。
文字列中で pattern にマッチする部分全てを
文字列 replace で置き換えた文字列を生成して返します。
置換文字列 replace 中の \& と \0 はマッチした部分文字列に、
\1 ... \9 は n 番目の括弧の内容に置き換えられます。
置換文字列内では \`、\'、\+ も使えます。
これらは $`、$'、$+ に対応します。
@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した... -
String
# sub(pattern , replace) -> String (24337.0) -
文字列中で pattern にマッチした最初の部分を 文字列 replace で置き換えた文字列を生成して返します。
文字列中で pattern にマッチした最初の部分を
文字列 replace で置き換えた文字列を生成して返します。
置換文字列 replace 中の \& と \0 はマッチした部分文字列に、
\1 ... \9 は n 番目の括弧の内容に置き換えられます。
置換文字列内では \`、\'、\+ も使えます。
これらは $`、$'、$+ に対応します。
@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定し... -
RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (24319.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
引数 source で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path 引数 file の絶対パスファイル名を文字列で指定します。
@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
... -
RubyVM
:: InstructionSequence . new(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (24319.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
引数 source で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path 引数 file の絶対パスファイル名を文字列で指定します。
@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
... -
String
# gsub(pattern , hash) -> String (24310.0) -
文字列中の pattern にマッチした部分をキーにして hash を引いた値で置き換えます。
文字列中の pattern にマッチした部分をキーにして hash を引いた値で置き換えます。
@param pattern 置き換える文字列のパターン
@param hash 置き換える文字列を与えるハッシュ
//emlist[例][ruby]{
hash = {'b'=>'B', 'c'=>'C'}
p "abcabc".gsub(/[bc]/){hash[$&]} #=> "aBCaBC"
p "abcabc".gsub(/[bc]/, hash) #=> "aBCaBC"
//} -
String
# sub(pattern , hash) -> String (24307.0) -
文字列中の pattern にマッチした部分をキーにして hash を引いた値で置き換えます。
文字列中の pattern にマッチした部分をキーにして hash を引いた値で置き換えます。
@param pattern 置き換える文字列のパターン
@param hash 置き換える文字列を与えるハッシュ
//emlist[例][ruby]{
hash = {'b'=>'B', 'c'=>'C'}
p "abcabc".sub(/[bc]/){hash[$&]} #=> "aBCabc"
p "abcabc".sub(/[bc]/, hash) #=> "aBCabc"
//}