947件ヒット
[1-100件を表示]
(0.065秒)
別のキーワード
ライブラリ
- ビルトイン (499)
- continuation (22)
- fiddle (33)
- logger (11)
- open-uri (4)
- openssl (33)
-
rubygems
/ requirement (11) - set (22)
- tracer (22)
- tsort (85)
-
webrick
/ httpproxy (11) -
webrick
/ httpserver (22)
クラス
- BasicObject (22)
-
Fiddle
:: Function (11) -
Fiddle
:: Handle (22) -
Gem
:: Requirement (11) - Hash (11)
- Logger (11)
- Method (10)
- Module (11)
-
OpenSSL
:: SSL :: SSLContext (22) -
OpenSSL
:: X509 :: Store (11) - Proc (85)
- Set (22)
- SystemCallError (11)
- Thread (22)
-
Thread
:: Backtrace :: Location (44) - TracePoint (116)
- Tracer (22)
-
WEBrick
:: HTTPProxyServer (11) -
WEBrick
:: HTTPServer (22)
モジュール
- Enumerable (44)
- Kernel (127)
- TSort (85)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (6)
- === (11)
- >> (6)
- Continuation (11)
-
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - OPS (11)
- Proc (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Rubyの起動 (3)
- [] (11)
-
_ _ callee _ _ (11) -
absolute
_ path (11) -
add
_ filter (22) -
add
_ trace _ func (11) -
base
_ label (11) - binding (11)
- callcc (11)
-
callee
_ id (11) - caller (33)
-
caller
_ locations (22) -
default
_ proc (11) -
defined
_ class (11) - detect (22)
- divide (22)
-
each
_ strongly _ connected _ component (21) -
each
_ strongly _ connected _ component _ from (21) - errno (11)
- event (11)
- find (22)
- formatter (11)
- inspect (22)
-
instance
_ eval (22) -
instance
_ method (11) - lambda (17)
- lambda? (11)
- lineno (11)
-
method
_ id (11) -
mount
_ proc (22) - new (62)
- open (4)
- parameters (6)
- path (11)
- proc (18)
- rdoc (11)
-
rdoc
/ parser / c (11) -
rexml
/ parsers / sax2parser (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
set
_ trace _ func (22) -
strongly
_ connected _ components (11) -
super
_ method (10) -
tmp
_ dh _ callback (11) -
to
_ s (11) - trace (11)
- tsort (22)
-
tsort
_ each (21) -
verify
_ callback (22) - yield (11)
- クラス/メソッドの定義 (11)
- メソッド呼び出し(super・ブロック付き・yield) (11)
- 制御構造 (11)
- 手続きオブジェクトの挙動の詳細 (11)
- 正規表現 (11)
検索結果
先頭5件
-
Fiddle
:: Function # call(*args) -> Integer|DL :: CPtr|nil (18303.0) -
関数を呼び出します。
関数を呼び出します。
Fiddle::Function.new で指定した引数と返り値の型に基いて
Ruby のオブジェクトを適切に C のデータに変換して C の関数を呼び出し、
その返り値を Ruby のオブジェクトに変換して返します。
引数の変換は以下の通りです。
: void* (つまり任意のポインタ型)
nil ならば C の NULL に変換されます
Fiddle::Pointer は保持している C ポインタに変換されます。
文字列であればその先頭ポインタになります。
IO オブジェクトであれば FILE* が渡されます。
整数であればそれがアドレスとみ... -
Proc
# call(*arg) -> () (15243.0) -
手続きオブジェクトを実行してその結果を返します。
...mbda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end
p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1
//}
また、以下のような syntactic sugar もあります。
//emlist[例][ruby]{
fib = lambda{|n|
case n
when 0 then 0
when 1 then 1
else
fib.(n - 2) +......fib.(n - 1)
end
}
fib.(10) # => 55
//}
@param arg 手続きオブジェクトに与える引数を指定します。
@raise LocalJumpError Procを生成したメソッドからリターンしてしまった場合に発生します。... -
TracePoint
# callee _ id -> Symbol | nil (6319.0) -
イベントが発生したメソッドの呼ばれた名前を Symbol で返します。 トップレベルであった場合は nil を返します。
...した場合に発生します。
//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end
trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_id] # => [:method_name, :alias_name]
end
trace.enable do
C.new.alias_name
end
//}
@see TracePoint#method_id... -
Kernel
. # caller(range) -> [String] | nil (6303.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した値が範囲外の場合は nil を......el.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"]
# [......、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(... -
Kernel
. # caller(start = 1) -> [String] | nil (6303.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した値が範囲外の場合は nil を......el.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"]
# [......、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(... -
Kernel
. # caller(start , length) -> [String] | nil (6303.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した値が範囲外の場合は nil を......el.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"]
# [......、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (6302.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...y]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (6302.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...y]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Kernel
. # _ _ callee _ _ -> Symbol | nil (6301.0) -
現在のメソッド名を返します。 メソッドの外で呼ばれると nil を返します。
...名を返します。
メソッドの外で呼ばれると nil を返します。
//emlist[例][ruby]{
def foo
p __callee__
end
alias :bar :foo
foo # => :foo
bar # => :bar
p __callee__ # => nil
//}
Kernel.#__method__ とは異なり、現在のメソッド名が alias されたメ
ソッドの... -
Kernel
. # callcc {|cont| . . . . } -> object (6301.0) -
継続を作成します。 Continuation を参照してください。
継続を作成します。 Continuation を参照してください。