249件ヒット
[201-249件を表示]
(0.042秒)
ライブラリ
- ビルトイン (141)
- json (12)
-
rdoc
/ stats (12) - win32ole (84)
クラス
- Array (9)
- Method (36)
- Object (24)
- Proc (12)
-
RDoc
:: Stats (12) -
RubyVM
:: InstructionSequence (12) - UnboundMethod (48)
-
WIN32OLE
_ METHOD (84)
モジュール
キーワード
- arity (24)
- dig (9)
- dispid (12)
-
first
_ lineno (12) - hash (24)
- helpcontext (12)
- invkind (12)
-
num
_ methods (12) -
offset
_ vtbl (12) - owner (12)
-
public
_ method (12) -
return
_ vtype (12) -
size
_ opt _ params (12) -
size
_ params (12) -
source
_ location (36) -
to
_ json (12)
検索結果
先頭5件
-
UnboundMethod
# hash -> Integer (3114.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
//emlist[例][ruby]{
a = method(:==).unbind
b = method(:eql?).unbind
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}... -
UnboundMethod
# owner -> Class | Module (3043.0) -
このメソッドが定義されている class か module を返します。
...このメソッドが定義されている class か module を返します。
//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//}... -
Proc
# source _ location -> [String , Integer] | nil (114.0) -
ソースコードのファイル名と行番号を配列で返します。
...by]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ["(eval)", 1]
method(:p).to_proc.source_location # => nil
//}
@see Method#source_location... -
RubyVM
:: InstructionSequence # first _ lineno -> Integer (114.0) -
self が表す命令シーケンスの 1 行目の行番号を返します。
...の 1 行目の行番号を返します。
例1:irb で実行した場合
RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1
例2:
# /tmp/method.rb
require "foo-library"
def foo
p :foo
end
RubyVM::InstructionSequence.of(method(:foo)).first_lineno
# => 2... -
Array
# dig(idx , . . . ) -> object | nil (13.0) -
self 以下のネストしたオブジェクトを dig メソッドで再帰的に参照して返し ます。途中のオブジェクトが nil であった場合は nil を返します。
...ます。
//emlist[例][ruby]{
a = [[1, [2, 3]]]
a.dig(0, 1, 1) # => 3
a.dig(1, 2, 3) # => nil
a.dig(0, 0, 0) # => TypeError: Integer does not have #dig method
[42, {foo: :bar}].dig(1, :foo) # => :bar
//}
@see Hash#dig, Struct#dig, OpenStruct#dig...