344件ヒット
[301-344件を表示]
(0.087秒)
別のキーワード
種類
- インスタンスメソッド (238)
- 特異メソッド (46)
- モジュール関数 (27)
- ライブラリ (22)
- 文書 (11)
ライブラリ
- ビルトイン (122)
- csv (22)
- dbm (11)
- gdbm (11)
- matrix (11)
-
minitest
/ spec (1) -
minitest
/ unit (1) - pathname (8)
- pp (11)
- readline (11)
-
rexml
/ document (22) -
rexml
/ parsers / pullparser (11) -
rubygems
/ package / tar _ header (11) - sdbm (11)
- set (11)
- strscan (22)
- thread (2)
- thwait (12)
クラス
- Array (11)
-
CSV
:: Row (11) -
CSV
:: Table (11) - DBM (11)
- Dir (8)
- File (16)
- GDBM (11)
-
Gem
:: Package :: TarHeader (11) - Hash (11)
- Matrix (11)
- Object (12)
- Pathname (8)
-
REXML
:: Elements (11) -
REXML
:: Parsers :: PullParser (11) -
REXML
:: Text (11) - SDBM (11)
- Set (11)
- String (11)
- StringScanner (22)
- Symbol (11)
-
Thread
:: Queue (11) -
Thread
:: SizedQueue (7) - ThreadsWait (12)
モジュール
- FileTest (16)
- Kernel (11)
-
MiniTest
:: Assertions (1)
オブジェクト
- ENV (11)
-
Readline
:: HISTORY (11)
キーワード
-
assert
_ empty (1) -
cgi
/ session (11) - eos? (11)
-
must
_ be _ empty (1) -
next
_ wait (6) - pp (11)
-
pretty
_ print _ cycle (11) - warn (11)
- zero? (16)
- 制御構造 (11)
検索結果
先頭5件
-
Kernel
. # warn(*message , uplevel: nil , category: nil) -> nil (206.0) -
message を 標準エラー出力 $stderr に出力します。 $VERBOSE フラグ が nil のときは何も出力しません。
...指定しない場合は、
このメソッドは以下と同じです。
//emlist[][ruby]{
$stderr.puts(*message) if !$VERBOSE.nil? && !message.empty?
nil
//}
@param message 出力するオブジェクトを任意個指定します。
@param uplevel いくつ前の呼び出し元のファイル......!" #=> caution!
$VERBOSE = nil
warn "caution!" # 何もしない
//}
//emlist[uplevel の例][ruby]{
def foo
warn("test message", uplevel: 0) # => test.rb:2: warning: test message
warn("test message", uplevel: 1) # => test.rb:6: warning: test message
warn("test message", uplevel: 2) # => test......//}
//emlist[category の例][ruby]{
Warning[:deprecated] = true # 非推奨の警告を表示する
warn("deprecated!!", category: :deprecated)
# => deprecated!
Warning[:deprecated] = false # 非推奨の警告を表示しない
warn("deprecated!!", category: :deprecated)
# 警告は出力され... -
MiniTest
:: Assertions # assert _ empty(object , message = nil) -> true (206.0) -
与えられたオブジェクトが空である場合、検査にパスしたことになります。
...roc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 与えられたオブジェクトが empty? メソッドを持たない場合に発生します。
また、与えられたオブジェクトが空でない場合... -
Object
# must _ be _ empty -> true (206.0) -
自身が空である場合、検査にパスしたことになります。
...自身が空である場合、検査にパスしたことになります。
@raise MiniTest::Assertion 自身が empty? メソッドを持たない場合に発生します。
また、自身が空でない場合にも発生します。
@see MiniTest::Assertions#assert_e... -
Object
# pretty _ print _ cycle(pp) -> () (206.0) -
プリティプリント時にオブジェクトの循環参照が検出された場合、 Object#pretty_print の代わりに呼ばれるメソッドです。
...の pp の出力をカスタマイズしたい場合は、
このメソッドも再定義する必要があります。
@param pp PP オブジェクトです。
//emlist[][ruby]{
class Array
def pretty_print_cycle(q)
q.text(empty? ? '[]' : '[...]')
end
end
//}
@see Object#pretty_print... -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (206.0) -
指定したスレッドのどれかが終了するまで待ちます。
...rue でかつ、キューが空の時、発生します。
#使用例
require 'thwait'
threads = []
2.times {|i|
threads << Thread.new { sleep i }
}
thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end
@see Queue#pop... -
pp (42.0)
-
オブジェクトなどを見やすく出力するためのライブラリです。
...y-print されてない出力:
#<PP:0x81a0d10 @stack=[], @genspace=#<Proc:0x81a0cc0>, @nest=[0], @newline="\n",
@buf=#<PrettyPrint::Group:0x81a0c98 @group=0, @tail=0, @buf=[#<PrettyPrint::Gro
up:0x81a0ba8 @group=1, @tail=0, @buf=[#<PrettyPrint::Text:0x81a0b30 @tail=2, @wi
dth=1, @text="[">,......:0x81a09f0 @tail=1, @width=1, @text="1">], @singleline_width=1>, #
<PrettyPrint::Text:0x81a0a7c @tail=0, @width=1, @text=",">, #<PrettyPrint::Break
able:0x81a0a2c @group=2, @gensace=#<Proc:0x81a0cc0>, @newline="\n", @indent=1, @
tail=2, @sep=" ", @width=1>, #<PrettyPrint::Group:0x81a09c8 @grou......ize > 10
q.pp(v[0..9] + '...')
else
q.pp v
end
end
first = false
}
end
q.breakable
q.text "</hash>"
end
def pretty_print_cycle(q)
q.text(empty? ? '{}' : '{...}')
end
end
h = {:a => 'a'*5, :b => 'b'*10, :c => 'c... -
制御構造 (36.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...めとする制御構造をクラス設計者が定義する事が出来るものです.
=== 条件分岐
====[a:if] if
//emlist[例][ruby]{
if age >= 12 then
print "adult fee\n"
else
print "child fee\n"
end
gender = if foo.gender == "male" then "male" else "female" end
//}
文法:......はその引数になります。
====[a:next] next
//emlist[例][ruby]{
# 空行を捨てるcat
ARGF.each_line do |line|
next if line.strip.empty?
print line
end
//}
文法:
next
next val
nextはもっとも内側のループの次の繰り返しにジャンプしま......ます。
//emlist[][ruby]{
def iter
# (a)
# :
# (b)
yield
# (c)
# :
# (d)
end
iter { redo } # -> (b) へ飛ぶ
iter { next } # -> (c) へ飛ぶ
iter { break } # -> (d) へ飛ぶ
//}
(a) は、厳密には引数評価から始まります。(b) はブロック実行の直前...