クラス
-
ARGF
. class (99) - Array (77)
- BasicObject (55)
- Class (11)
- Data (4)
- Dir (11)
-
Encoding
:: Converter (22) -
Encoding
:: InvalidByteSequenceError (11) -
Encoding
:: UndefinedConversionError (11) - Enumerator (33)
-
Enumerator
:: Lazy (10) - File (11)
-
File
:: Stat (55) - Hash (11)
- IO (44)
- Integer (22)
- MatchData (11)
- Method (22)
- Module (90)
- Object (138)
- Proc (6)
- Range (6)
- Regexp (55)
-
RubyVM
:: AbstractSyntaxTree :: Node (6) -
RubyVM
:: InstructionSequence (66) - SignalException (11)
- String (110)
- Struct (22)
- Thread (36)
-
Thread
:: Backtrace :: Location (44) -
Thread
:: ConditionVariable (18) -
Thread
:: Queue (27) -
Thread
:: SizedQueue (27) - ThreadGroup (11)
- TracePoint (12)
- UnboundMethod (10)
モジュール
- Enumerable (66)
キーワード
- ! (11)
- != (11)
- << (6)
- === (28)
- =~ (11)
- [] (11)
-
absolute
_ path (22) - add (11)
-
alias
_ method (11) -
base
_ label (22) -
bind
_ call (10) - blockdev? (11)
- broadcast (9)
- chardev? (11)
-
const
_ added (2) - convert (11)
- cycle (44)
- deconstruct (2)
-
deconstruct
_ keys (2) - deq (18)
- disasm (11)
- disassemble (11)
- dump (11)
- each (88)
-
each
_ line (44) - empty? (11)
-
enum
_ for (22) - eof (11)
- eof? (11)
-
error
_ bytes (11) -
error
_ char (11) -
eval
_ script (6) - fetch (33)
- flock (11)
- gsub (44)
-
ignore
_ deadlock= (3) - inherited (11)
- initialize (11)
-
initialize
_ copy (11) -
insert
_ output (11) - inspect (39)
-
instruction
_ sequence (6) - label (11)
- match (22)
-
max
_ by (44) -
method
_ added (11) -
method
_ removed (11) -
method
_ undefined (11) - next (11)
- owner (11)
- path (11)
- pid (11)
- pop (18)
- prepend (11)
- prepended (11)
-
public
_ send (22) - read (11)
- refine (11)
-
respond
_ to? (11) - run (11)
- setgid? (11)
- setuid? (11)
- shift (18)
- signal (9)
- signm (11)
-
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
source
_ location (11) - sticky? (11)
- sub (33)
- taint (6)
- tap (11)
- times (22)
-
to
_ enum (22) -
to
_ s (22) -
undef
_ method (11) - upto (11)
- wakeup (11)
-
with
_ index (10) -
with
_ object (22) - ~ (11)
検索結果
先頭5件
-
Thread
:: Backtrace :: Location # to _ s -> String (9.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...mlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (9.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...cePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts 'hello'")
end
//}
@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した... -
UnboundMethod
# bind _ call(recv , *args) -> object (9.0) -
self を recv に bind して args を引数として呼び出します。
...self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call... -
UnboundMethod
# bind _ call(recv , *args) { . . . } -> object (9.0) -
self を recv に bind して args を引数として呼び出します。
...self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call... -
String
# gsub(pattern) -> Enumerator (8.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 (8.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 , hash) -> String (8.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) {|matched| . . . . } -> String (8.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
# sub(pattern , hash) -> String (8.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"
//}