るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

String#tr(pattern, replace) -> String (29351.0)

pattern 文字列に含まれる文字を検索し、 それを replace 文字列の対応する文字に置き換えます。

...pattern 文字列に含まれる文字を検索し、
それを replace 文字列の対応する文字に置き換えます。

pattern の形式は tr(1) と同じです。つまり、
`a-c' は a から c を意味し、"^0-9" のように
文字列の先頭が `^' の場合は指定文字以外...
...が置換の対象になります。

replace に対しても `-' による範囲指定が可能です。

`-' は文字列の両端にない場合にだけ範囲指定の意味になります。
`^' も文字列の先頭にあるときにだけ否定の効果を発揮します。
また、`-', `^',...
...す。

replace の範囲が pattern の範囲よりも小さい場合は、
replace の最後の文字が無限に続くものとして扱われます。

@param pattern 置き換える文字のパターン
@param replace pattern で指定した文字を置き換える文字

//emlist[例][ru...

RubyVM::AbstractSyntaxTree (26002.0)

Ruby のコードをパースして得られる抽象構文木を扱うモジュールです。

...Ruby のコードをパースして得られる抽象構文木を扱うモジュールです。

抽象構文木はRubyVM::AbstractSyntaxTree::Nodeクラスのインスタンスとして表されます。


このモジュールはMRIの抽象構文木の実装の詳細を表します。

このモ...
...し安定したAPIやMRI以外の実装で抽象構文木を扱いたい場合、
parser gem (https://github.com/whitequark/parser)や
Ripperの使用を検討してください。
もし RubyVM::AbstractSyntaxTree のAPIを安定にしたい場合、14844 での議論に参加してください。...

TracePoint#instruction_sequence -> RubyVM::InstructionSequence (23402.0)

script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。

...iledイベント発生時にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。

//emlist[例][ruby]{
Tr
acePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
e
nd.enable do
e
val("puts 'hell...
...o'")
e
nd
//}

@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。...

RubyVM::InstructionSequence.load_from_binary_extra_data(binary) -> String (23302.0)

バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。

...埋め込まれたextra_dataを取り出します。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}

@see RubyVM::InstructionSequence#to_binary...

String.try_convert(obj) -> String | nil (23302.0)

obj を String に変換しようと試みます。変換には Object#to_str メソッ ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ た場合は nil が返されます。

...bj を String に変換しようと試みます。変換には Object#to_str メソッ
ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ
た場合は nil が返されます。

@param obj 変換する任意のオブジェクト
@return...
...変換後の文字列または nil

//emlist[例][ruby]{
String.try_convert("str") # => "str"
String.try_convert(/re/) # => nil
//}...

絞り込み条件を変える

TracePoint.trace(*events) {|obj| ... } -> TracePoint (23302.0)

新しい TracePoint オブジェクトを作成して自動的にトレースを開始し ます。TracePoint.new のコンビニエンスメソッドです。

...新しい TracePoint オブジェクトを作成して自動的にトレースを開始し
ます。TracePoint.new のコンビニエンスメソッドです。

@param events トレースするイベントを String か Symbol で任
意の数指定します。指定できる値に...
...ついては
Tr
acePoint.new を参照してください。

//emlist[例][ruby]{
tr
ace = TracePoint.trace(:call) { |tp| [tp.lineno, tp.event] }
# => #<TracePoint:0x007f786a452448>

tr
ace.enabled? # => true
//}

@raise ThreadError ブロックを指定しなかった場合に発生し...

Enumerable#each_entry -> Enumerator (23202.0)

ブロックを各要素に一度ずつ適用します。

...配列として渡されます。

//emlist[例][ruby]{
class Foo
include Enumerable
def each
yield 1
yield 1,2
e
nd
e
nd
Foo.new.each_entry{|o| print o, " -- "}
# => 1 -- [1, 2] --
//}

ブロックを省略した場合は Enumerator が返されます。

@see Enumerable#slice_before...

Enumerable#each_entry {|obj| block} -> self (23202.0)

ブロックを各要素に一度ずつ適用します。

...配列として渡されます。

//emlist[例][ruby]{
class Foo
include Enumerable
def each
yield 1
yield 1,2
e
nd
e
nd
Foo.new.each_entry{|o| print o, " -- "}
# => 1 -- [1, 2] --
//}

ブロックを省略した場合は Enumerator が返されます。

@see Enumerable#slice_before...

Enumerable#entries(*args) -> [object] (23202.0)

全ての要素を含む配列を返します。

...返します。

@param args each の呼び出し時に引数として渡されます。

//emlist[例][ruby]{
(1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7]
{ 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]]

require 'prime'
Prime.entries 10 #=> [2, 3...

Fiber#transfer(*args) -> object (23202.0)

自身が表すファイバーへコンテキストを切り替えます。

...すファイバーへコンテキストを切り替えます。

自身は Fiber#resume を呼んだファイバーの子となります。
Fiber#resume との違いは、ファイバーが終了したときや Fiber.yield が呼ばれたときは、
ファイバーの親へ戻らずにメインフ...
...イバーから呼び出した Fiber#resume メソッドの返り値として渡したいオブジェクトを指定します。

@return コンテキスト切り替えの際に、Fiber#resume メソッドに与えられた引数を返します。

@raise FiberError 自身が既に終了している...
...read クラスが表すスレッド間をまたがる場合、
Fiber#resume を呼んだファイバーがその親か先祖である場合に発生します。

//emlist[例:][ruby]{
require 'fiber'

fr1 = Fiber.new do |v|
:fugafuga
e
nd

fr2 = Fiber.new do |v|
fr1.transfer
:fuga
e
...

絞り込み条件を変える

Process::Sys.#setresgid(rid, eid, sid) -> nil (23202.0)

システムコールの setresgid を呼びます。

...コールの setresgid を呼びます。

@param rid システムコールの引数を整数で指定します。

@param eid システムコールの引数を整数で指定します。

@param sid システムコールの引数を整数で指定します。

@raise NotImplementedError システ...
...ムコールが現在のプラットフォームで提供されていない場合に発生します。

@raise Errno::EXXX システムコールに失敗した場合に発生します。...
<< 1 2 3 ... > >>