448件ヒット
[401-448件を表示]
(0.074秒)
モジュール
キーワード
- BigDecimal (14)
- Integer (7)
- Rational (7)
-
clock
_ gettime (12) -
each
_ object (48) - facility (12)
- fork (24)
- getpty (24)
- getrlimit (12)
- ident (12)
- mask (12)
- mask= (12)
-
memsize
_ of _ all (12) - rand (24)
- size? (12)
- spawn (72)
- sqrt (12)
- sysconf (12)
- test (24)
- wait (12)
- wait2 (12)
- waitall (12)
- waitpid (12)
- waitpid2 (12)
-
world
_ readable? (12)
検索結果
先頭4件
-
ObjectSpace
. # each _ object(klass) -> Enumerator (41.0) -
指定された klass と Object#kind_of? の関係にある全ての オブジェクトに対して繰り返します。引数が省略された時には全てのオブ ジェクトに対して繰り返します。 繰り返した数を返します。
...ace:each_object(false)>
//}
//emlist[例: 全てのオブジェクトを扱う][ruby]{
ObjectSpace.each_object.take(5).each { |x| p x }
count = ObjectSpace.each_object { |x| x }
puts "Total count: #{count}"
# => "scope"
# => "scopes"
# => "sym"
# => "class_names"
# => "@corrections"
# => Total cou......st[例: 任意のクラスを扱う][ruby]{
Person = Struct.new(:name)
s1 = Person.new("tanaka")
s2 = Person.new("sato")
count = ObjectSpace.each_object(Person) { |x| p x }
puts "Total count: #{count}"
# => #<struct Person name="sato">
# => #<struct Person name="tanaka">
# => Total count: 2
//}... -
Syslog
. # mask=(mask) (27.0) -
ログの優先度のマスクを取得または設定します。 マスクは永続的であり、 Syslog.openやSyslog.close ではリセットされません。
...pen('ftpd', LOG_PID | LOG_NDELAY, LOG_FTP)
Syslog.mask = Syslog::LOG_UPTO(LOG_ERR)
[ LOG_CRIT, LOG_ERR, LOG_WARNING,
LOG_NOTICE, LOG_INFO, LOG_DEBUG ].each_with_index { |c, i|
Syslog.log(c, "test for syslog FTP #{c}, #{i}")
}
Syslog.close
File.foreach(log){|line|
print line if... -
Kernel
. # test(cmd , file1 , file2) -> bool (19.0) -
2ファイル間のファイルテストを行います。
...イル1とファイル2が同一のファイルである
//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result = test(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}
# => =: true
# => <: false
# => >: false
# => -: false... -
Math
. # sqrt(x) -> Float (13.0) -
x の非負の平方根(principal square root)を返します。
...場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
0.upto(10) {|x|
p [x, Math.sqrt(x), Math.sqrt(x)**2]
}
# => [0, 0.0, 0.0]
# [1, 1.0, 1.0]
# [2, 1.4142135623731, 2.0]
# [3, 1.73205080756888, 3.0]
# [4,......2.0, 4.0]
# [5, 2.23606797749979, 5.0]
# [6, 2.44948974278318, 6.0]
# [7, 2.64575131106459, 7.0]
# [8, 2.82842712474619, 8.0]
# [9, 3.0, 9.0]
# [10, 3.16227766016838, 10.0]
//}
@see Integer.sqrt, Math.#cbrt...