1804件ヒット
[1601-1700件を表示]
(0.114秒)
ライブラリ
- ビルトイン (721)
- delegate (12)
- digest (12)
- e2mmap (6)
-
irb
/ cmd / load (12) -
irb
/ xmp (12) - json (24)
-
minitest
/ unit (1) - mkmf (612)
- open-uri (24)
- openssl (24)
- pathname (12)
- pp (12)
- psych (24)
- rake (36)
-
rubygems
/ custom _ require (12) - scanf (12)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - stringio (72)
- timeout (8)
- un (72)
- zlib (48)
クラス
-
ARGF
. class (75) - Array (48)
- BasicObject (24)
- Binding (12)
- Exception (24)
- IO (84)
-
IRB
:: ExtendCommand :: Load (12) - LoadError (12)
- Module (132)
- Object (144)
-
OpenSSL
:: BN (12) - Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - String (72)
- StringIO (72)
- SystemExit (12)
- Thread (72)
- TracePoint (12)
- UncaughtThrowError (22)
-
Zlib
:: GzipWriter (48)
モジュール
- Exception2MessageMapper (6)
- Kernel (836)
-
MiniTest
:: Assertions (1) -
OpenSSL
:: Buffering (12) -
OpenURI
:: OpenRead (24)
キーワード
- % (12)
- DelegateClass (12)
- Digest (12)
- JSON (12)
- Pathname (12)
- [] (18)
-
add
_ trace _ func (12) - ancestors (12)
- autoload (12)
-
cc
_ command (12) -
check
_ signedness (24) -
check
_ sizeof (24) - class (12)
-
class
_ eval (24) -
const
_ defined? (12) - constants (12)
-
convertible
_ int (24) - cp (12)
-
cpp
_ command (12) -
create
_ makefile (12) -
create
_ tmpsrc (12) -
defined
_ class (12) -
depend
_ rules (12) - desc (12)
-
egrep
_ cpp (24) - eval (12)
- exception (24)
- execute (12)
- exit (12)
-
find
_ executable (12) -
find
_ header (12) -
find
_ library (24) -
find
_ type (24) - freeze (12)
- gets (27)
-
have
_ header (24) -
have
_ macro (24) -
have
_ struct _ member (24) -
have
_ type (24) - help (12)
- hex (12)
- httpd (12)
- import (12)
- include (12)
- inspect (12)
- install (12)
-
install
_ files (12) -
instance
_ eval (24) -
instance
_ variables (12) - j (12)
- kill (12)
- libpathflag (12)
-
link
_ command (12) - method (12)
- mkdir (12)
-
module
_ eval (24) - namespace (12)
- oct (12)
- open (24)
- path (12)
-
pretty
_ print (24) - print (60)
- printf (60)
-
psych
_ y (12) -
public
_ instance _ method (12) - putc (36)
- puts (48)
- raise (12)
-
remove
_ const (12) - reopen (60)
- require (12)
- rmdir (12)
- sample (48)
- scanf (12)
- send (24)
-
set
_ trace _ func (12) - skip (1)
- status (12)
- tag (11)
- terminate (12)
- test (18)
- timeout (8)
-
to
_ a (12) -
to
_ ary (12) -
to
_ f (12) -
to
_ i (12) -
to
_ int (12) -
to
_ str (12) -
try
_ compile (24) -
try
_ constant (24) -
try
_ cpp (24) -
try
_ do (24) -
try
_ link (24) -
try
_ run (24) -
try
_ static _ assert (24) -
try
_ type (24) - value (11)
-
with
_ werror (24) - xmp (12)
- xpopen (24)
- xsystem (12)
- y (12)
検索結果
先頭5件
-
Module
# const _ defined?(name , inherit = true) -> bool (31.0) -
モジュールに name で指定される名前の定数が定義されている時真 を返します。
...とができます。
@param name String, Symbol で指定される定数名。
@param inherit false を指定するとスーパークラスや include したモジュールで
定義された定数は対象にはなりません。
//emlist[例][ruby]{
module Kernel
FOO = 1
end
# Object......include したモジュールの定数に対しても
# true を返す
p Object.const_defined?(:FOO) # => true
module Bar
BAR = 1
end
class Object
include Bar
end
# ユーザ定義のモジュールに対しても同様
p Object.const_defined?(:BAR) # => true
class Baz
include Bar
end
#......Object 以外でも同様になった
# 第二引数のデフォルト値が true であるため
p Baz.const_defined?(:BAR) # => true
# 第二引数を false にした場合
p Baz.const_defined?(:BAR, false) # => false
//}... -
Thread
# exit -> self (31.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 (31.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
# terminate -> self (31.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,... -
BasicObject
# instance _ eval {|obj| . . . } -> object (25.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを
評価してその結果を返します。
オブジェクトのコンテキストで評価するとは評価中の self をそのオブジェクトに......実行するということです。
また、文字列 expr やブロック中でメソッドを定義すればそのオブジェクトの特異メソッドが定義されます。
ただし、ローカル変数だけは、文字列 expr の評価では instance_eval の外側のスコープと、......。これはメソッド定義のネストと同じです。
d:spec/def#nest_method を参照してください。
BasicObject を継承して作ったクラス内で instance_eval する場合はトップレベルの定数や Kernel モジュールに定義されているメソッドは見えま... -
Module
# class _ eval {|mod| . . . } -> object (25.0) -
モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。
...モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを
評価してその結果を返します。
モジュールのコンテキストで評価するとは、実行中そのモジュールが self になるとい......す。
@param expr 評価される文字列。
@param fname 文字列を指定します。ファイル fname に文字列 expr が書かれているかのように実行されます。
スタックトレースの表示などを差し替えることができます。
@param lineno......文字列を指定します。行番号 lineno から文字列 expr が書かれているかのように実行されます。
スタックトレースの表示などを差し替えることができます。
//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m... -
Module
# include(*mod) -> self (25.0) -
モジュール mod をインクルードします。
...モジュール mod をインクルードします。
@param mod Module のインスタンス( Enumerable など)を指定します。
@raise ArgumentError 継承関係が循環してしまうような include を行った場合に発生します。
//emlist[例][ruby]{
module M
end
module M2......include M
end
module M
include M2
end
//}
実行結果:
-:3:in `append_features': cyclic include detected (ArgumentError)
from -:3:in `include'
from -:3
インクルードとは、指定されたモジュールの定義
(メソッド、定数) を引き継ぐことです......用いられており、 mix-in とも呼びます。
//emlist[例][ruby]{
class C
include FileTest
include Math
end
p C.ancestors
# => [C, Math, FileTest, Object, Kernel]
//}
モジュールの機能追加は、クラスの継承関係の間にそのモジュールが挿入
されること... -
Module
# module _ eval {|mod| . . . } -> object (25.0) -
モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。
...モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを
評価してその結果を返します。
モジュールのコンテキストで評価するとは、実行中そのモジュールが self になるとい......す。
@param expr 評価される文字列。
@param fname 文字列を指定します。ファイル fname に文字列 expr が書かれているかのように実行されます。
スタックトレースの表示などを差し替えることができます。
@param lineno......文字列を指定します。行番号 lineno から文字列 expr が書かれているかのように実行されます。
スタックトレースの表示などを差し替えることができます。
//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m... -
Object
# to _ a -> Array (25.0) -
オブジェクトを配列に変換した結果を返します。 デフォルトでは定義されていません。
...のメソッドは実際には Object クラスには定義されていません。
必要に応じてサブクラスで定義すべきものです。
//emlist[][ruby]{
p( {'a'=>1}.to_a ) # [["a", 1]]
p ['array'].to_a # ["array"]
p nil.to_a # []
//}
@see Object#to_ary,Kernel.#Array... -
UncaughtThrowError
# tag -> object (23.0) -
Kernel.#throw に指定した tag を返します。
...
Kernel.#throw に指定した tag を返します。
//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.tag # => ":uncaught_label"
end
//}...