984件ヒット
[1-100件を表示]
(0.036秒)
クラス
-
ARGF
. class (176) - Array (66)
- BasicObject (22)
- Binding (11)
- Enumerator (11)
- Exception (22)
- IO (77)
- LoadError (11)
- Method (11)
- Module (154)
- Object (143)
- Random (33)
- Rational (11)
- String (66)
- SystemExit (11)
- Thread (88)
-
Thread
:: Backtrace :: Location (11) - TracePoint (11)
- UnboundMethod (21)
- UncaughtThrowError (20)
モジュール
- Warning (8)
キーワード
- % (11)
-
add
_ trace _ func (11) -
alias
_ method (11) - ancestors (11)
- autoload (11)
- autoload? (11)
-
backtrace
_ locations (22) -
bind
_ call (10) - class (11)
-
class
_ eval (22) -
class
_ variables (11) -
const
_ defined? (11) - constants (11)
- convert (11)
-
defined
_ class (11) - eval (11)
- exception (22)
- exit (11)
- freeze (11)
- gets (33)
- hex (11)
- include (11)
- inspect (11)
-
instance
_ eval (22) -
instance
_ variables (11) - kill (11)
- method (11)
-
module
_ eval (22) - next (11)
- oct (11)
- owner (22)
- path (11)
- print (22)
- printf (22)
-
public
_ instance _ method (11) - putc (22)
- puts (22)
- raise (11)
- rand (33)
- readline (33)
- readlines (33)
-
remove
_ const (11) - reopen (33)
- sample (44)
- send (22)
-
set
_ trace _ func (11) - shuffle! (22)
-
singleton
_ method (11) - status (11)
- tag (10)
- terminate (11)
-
to
_ a (44) -
to
_ ary (11) -
to
_ f (11) -
to
_ i (11) -
to
_ int (11) -
to
_ r (11) -
to
_ s (22) -
to
_ str (11) - value (10)
- warn (8)
検索結果
先頭5件
-
LoadError
# path -> String | nil (35.0) -
Kernel.#require や Kernel.#load に失敗したパスを返します。
...
Kernel.#require や Kernel.#load に失敗したパスを返します。
begin
require 'this/file/does/not/exist'
rescue LoadError => e
e.path # => 'this/file/does/not/exist'
end
パスが定まらない場合は nil を返します。... -
IO
# puts(*obj) -> nil (31.0) -
各 obj を self に出力し、それぞれの後に改行を出力します。 引数の扱いは Kernel.#puts と同じです。詳細はこちらを参照し てください。
...し、それぞれの後に改行を出力します。
引数の扱いは Kernel.#puts と同じです。詳細はこちらを参照し
てください。
@param obj 出力したいオブジェクトを指定します。Kernel.#puts と同じです。
@raise IOError 自身が書き込み用にオ......ープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
$stdout.puts("this", "is", "a", "test", [1, [nil, 3]])
#=>
this
is
a
test
1
3
@see Kernel.#puts... -
Module
# autoload(const _ name , feature) -> nil (31.0) -
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
...定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
const_name が autoload 設定されていて、まだ定義されてない(ロードされていない)ときは、
autoload する対象を置き換えます。
const_name が(autoload......子を含めることはできません。
つまり、self の直下に定義された定数しか指定できません。
@param feature Kernel.#require と同様な方法で autoload する対象を指定する。
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar......nstant Bar referenced by Foo::Bar
# Bar
# nil
//}
これは以下のようにネストせずに定義したのと同じことです。
//emlist[例][ruby]{
class Foo
end
class Bar
end
p Foo::Bar
#=> -:5: warning: toplevel constant Bar referenced by Foo::Bar
# Bar
//}
@see Kernel.#autoload......ない場
合、NameError が発生します。
//emlist[例][ruby]{
# ------- /tmp/bar.rb ---------
class Bar
end
# ----- end of /tmp/bar.rb ----
class Foo
autoload :Bar, '/tmp/bar.rb'
end
p Foo::Bar
#=> -:4:in `<main>': uninitialized constant Foo::Bar (NameError)
//}
@see Kernel.#autoload... -
IO
# printf(format , *arg) -> nil (27.0) -
C 言語の printf と同じように、format に従い引数 を文字列に変換して、self に出力します。
...IO を指定できないこと、引数を省略できないことを除けば Kernel.#printf と同じです。
@param format Kernel.#printf と同じです。print_format を参照してください。
@param arg Kernel.#printf と同じです。
@raise IOError 自身が書き込み用にオー......プンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
@see Kernel.#printf... -
Module
# public _ instance _ method(name) -> UnboundMethod (27.0) -
self の public インスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...を引数として与えると発生します。
//emlist[例][ruby]{
Kernel.public_instance_method(:object_id) #=> #<UnboundMethod: Kernel#object_id>
Kernel.public_instance_method(:p) # method `p' for module `Kernel' is private (NameError)
//}
@see Module#instance_method,Object#public_m... -
Random
# rand -> Float (27.0) -
一様な擬似乱数を発生させます。
...に負の数値を与えた時や (1..0) のような値が存在しない範囲を渡した時などに発生します。
//emlist[例][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.......-25 03:11:42 +0900
require 'date'
prng.rand(Date.new(2012, 1, 1) ... Date.new(2013,1,1)) # => #<Date: 2012-01-31 ((2455958j,0s,0n),+0s,2299161j)>
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0......見える
# 上と同じ種で再初期化
prng = Random.new(1234)
srand(1234)
# Kernel.#rand は Array#sample などの影響を受けて値がずれることがある
[0, 1].sample
prng.rand #=> 0.1915194503788923
rand #=> 0.6221087710398319
//}
@see Kernel.#rand... -
Random
# rand(max) -> Integer | Float (27.0) -
一様な擬似乱数を発生させます。
...に負の数値を与えた時や (1..0) のような値が存在しない範囲を渡した時などに発生します。
//emlist[例][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.......-25 03:11:42 +0900
require 'date'
prng.rand(Date.new(2012, 1, 1) ... Date.new(2013,1,1)) # => #<Date: 2012-01-31 ((2455958j,0s,0n),+0s,2299161j)>
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0......見える
# 上と同じ種で再初期化
prng = Random.new(1234)
srand(1234)
# Kernel.#rand は Array#sample などの影響を受けて値がずれることがある
[0, 1].sample
prng.rand #=> 0.1915194503788923
rand #=> 0.6221087710398319
//}
@see Kernel.#rand... -
Random
# rand(range) -> Integer | Float (27.0) -
一様な擬似乱数を発生させます。
...に負の数値を与えた時や (1..0) のような値が存在しない範囲を渡した時などに発生します。
//emlist[例][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.......-25 03:11:42 +0900
require 'date'
prng.rand(Date.new(2012, 1, 1) ... Date.new(2013,1,1)) # => #<Date: 2012-01-31 ((2455958j,0s,0n),+0s,2299161j)>
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0......見える
# 上と同じ種で再初期化
prng = Random.new(1234)
srand(1234)
# Kernel.#rand は Array#sample などの影響を受けて値がずれることがある
[0, 1].sample
prng.rand #=> 0.1915194503788923
rand #=> 0.6221087710398319
//}
@see Kernel.#rand... -
Thread
# exit -> self (27.0) -
スレッドの実行を終了させます。終了時に ensure 節が実行されます。
...スを Kernel.#exit(0)
により終了します。
Kernel.#exit と違い例外 SystemExit を発生しません。
th1 = Thread.new do
begin
sleep 10
ensure
p "this will be displayed"
end
end
sleep 0.1
th1.kill
#=> "this will be displayed"
@see Kernel.#exit,... -
Thread
# kill -> self (27.0) -
スレッドの実行を終了させます。終了時に ensure 節が実行されます。
...スを Kernel.#exit(0)
により終了します。
Kernel.#exit と違い例外 SystemExit を発生しません。
th1 = Thread.new do
begin
sleep 10
ensure
p "this will be displayed"
end
end
sleep 0.1
th1.kill
#=> "this will be displayed"
@see Kernel.#exit,...