53件ヒット
[1-53件を表示]
(0.288秒)
種類
- インスタンスメソッド (42)
- モジュール関数 (11)
ライブラリ
- ビルトイン (53)
モジュール
- Kernel (11)
キーワード
- exit (11)
-
initialize
_ copy (9) -
to
_ s (11)
検索結果
先頭5件
-
TrueClass
# inspect -> String (35135.0) -
常に文字列 "true" を返します。
...常に文字列 "true" を返します。
//emlist[例][ruby]{
true.inspect # => "true"
//}... -
Proc
# inspect -> String (26107.0) -
self の文字列表現を返します。
...self の文字列表現を返します。
可能なら self を生成したソースファイル名、行番号を含みます。
//emlist[例][ruby]{
p Proc.new {
true
}.to_s
# => "#<Proc:0x0x401a880c@-:3>"
//}... -
Proc
# to _ s -> String (11007.0) -
self の文字列表現を返します。
...self の文字列表現を返します。
可能なら self を生成したソースファイル名、行番号を含みます。
//emlist[例][ruby]{
p Proc.new {
true
}.to_s
# => "#<Proc:0x0x401a880c@-:3>"
//}... -
Kernel
. # exit(status = true) -> () (8119.0) -
Rubyプログラムの実行を終了します。status として整 数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 0(正常終了)です。
...の値を Ruby コマンドの終了ステータスとします。
デフォルトの終了ステータスは 0(正常終了)です。
status が true の場合 0、 false の場合 1 を引数に指定したとみなされます。この値はCレベルの定数
EXIT_SUCCESS、EXIT_FAILURE の値......ができます。
@param status 終了ステータスを整数か true または false で与えます。
//emlist[例][ruby]{
puts 'start'
begin
puts 'start1...'
exit
rescue SystemExit => err
puts "end1 with #{err.inspect}"
end
begin
puts 'start2...'
exit
ensure
puts 'end2...'
end
p... -
Object
# initialize _ copy(obj) -> object (8018.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...//emlist[][ruby]{
obj = Object.new
class <<obj
attr_accessor :foo
def bar
:bar
end
end
def check(obj)
puts "instance variables: #{obj.inspect}"
puts "tainted?: #{obj.tainted?}"
print "singleton methods: "
begin
p obj.bar
rescue NameError
p $!
end
end
obj.foo = 1
obj.t......>
check obj.dup
#=> instance variables: #<Object:0x4019c9c0 @foo=1>
# tainted?: true
# singleton methods: #<NoMethodError: ...>
check obj.clone
#=> instance variables: #<Object:0x4019c880 @foo=1>
# tainted?: true
# singleton methods: :bar
//}...