ライブラリ
- ビルトイン (121)
- bigdecimal (22)
- csv (11)
- erb (11)
-
minitest
/ unit (3) - mkmf (22)
- pathname (11)
- rake (11)
-
rubygems
/ command _ manager (11) -
rubygems
/ doc _ manager (11) -
rubygems
/ gem _ runner (11) -
rubygems
/ server (11) -
rubygems
/ specification (22) - scanf (6)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) - stringio (11)
- strscan (11)
- un (11)
-
webrick
/ server (11)
クラス
- BigDecimal (22)
- CSV (11)
- ERB (11)
- File (11)
- Float (11)
-
Gem
:: CommandManager (11) -
Gem
:: DocManager (11) -
Gem
:: GemRunner (11) -
Gem
:: Server (11) -
Gem
:: Specification (22) - Integer (11)
-
MiniTest
:: Unit (2) -
MiniTest
:: Unit :: TestCase (1) - Mutex (2)
- Numeric (11)
- Pathname (11)
-
RDoc
:: Options (22) -
Rake
:: Application (11) - Rational (11)
-
Scanf
:: FormatString (6) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - StringIO (11)
- StringScanner (11)
- Thread (33)
-
Thread
:: Mutex (9) - ThreadGroup (22)
-
WEBrick
:: GenericServer (11)
モジュール
- Kernel (33)
キーワード
- add (11)
-
add
_ runtime _ dependency (11) -
dry
_ run (11) -
dry
_ run= (11) - list (11)
-
matched
_ size (11) - prune (6)
-
run
_ rdoc (11) -
run
_ test _ suites (1) -
runtime
_ dependencies (11) - sleep (11)
- status (11)
- touch (11)
- truncate (128)
-
try
_ run (22) - wakeup (11)
検索結果
先頭5件
-
Integer
# truncate(ndigits = 0) -> Integer (12201.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
Integer
# truncate(ndigits = 0) -> Integer | Float (12201.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1.0
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
Numeric
# truncate -> Integer (12201.0) -
0 から 自身までの整数で、自身にもっとも近い整数を返します。
...0 から 自身までの整数で、自身にもっとも近い整数を返します。
//emlist[例][ruby]{
1.truncate #=> 1
1.2.truncate #=> 1
(-1.2).truncate #=> -1
(-1.5).truncate #=> -1
//}
@see Numeric#ceil, Numeric#floor, Numeric#round... -
Pathname
# truncate(length) -> 0 (12201.0) -
File.truncate(self.to_s, length) と同じです。
...File.truncate(self.to_s, length) と同じです。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
# truncate(path , length) -> 0 (12201.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
:: CommandProcessor # truncate(path , length) -> 0 (12201.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
:: Filter # truncate(path , length) -> 0 (12201.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
StringIO
# truncate(len) -> Integer (12201.0) -
自身のサイズが len になるように、自身を切り詰め、もしくは拡大します。 拡大した場合は、その部分を 0 で埋めます。 len を返します。
...でない時に発生します。
@raise Errno::EINVAL len がマイナスの時に発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge", 'r+')
a.truncate(2)
a.string #=> "ho"
a.truncate(5)
a.string #=> "ho\000\000\000"
//}... -
Float
# truncate -> Integer (6201.0) -
小数点以下を切り捨てて値を整数に変換します。
...小数点以下を切り捨てて値を整数に変換します。
//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}
@see Numeric#round, Numeric#ceil, Numeric#floor... -
Float
# truncate(ndigits = 0) -> Integer | Float (6201.0) -
小数点以下を切り捨てて値を整数に変換します。
...す。
小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
1.234567.truncate(2) # => 1.23
34567.89.truncate(-2) # => 34500
//}
@see Numeric#round, Numeric#ceil, Numeric#floor... -
Gem
:: Specification # add _ runtime _ dependency(gem , *requirements) -> [Gem :: Dependency] (6201.0) -
この gem の RUNTIME 依存性を追加します。 実行時に必要となる gem を指定します。
...この gem の RUNTIME 依存性を追加します。
実行時に必要となる gem を指定します。
//emlist[][ruby]{
# https://github.com/rurema/bitclust/blob/v1.2.3/bitclust-core.gemspec#L25
s.add_runtime_dependency "progressbar", ">= 1.9.0", "< 2.0"
//}
@param gem 依存する gem の......名前か Gem::Dependency のインスタンスを指定します。
@param requirements バージョンの必要条件を 0 個以上指定します。デフォルトは ">= 0" です。
@see Gem::Specification#add_development_dependency, Gem::Dependency... -
Rational
# truncate(precision = 0) -> Rational | Integer (6201.0) -
小数点以下を切り捨てて値を整数に変換します。
...t[例][ruby]{
Rational(2, 3).to_i # => 0
Rational(3).to_i # => 3
Rational(300.6).to_i # => 300
Rational(98, 71).to_i # => 1
Rational(-31, 2).to_i # => -15
//}
precision を指定した場合は指定した桁数で切り捨てた整数か
Rational を返します。
//emlist[例][ruby]{
Ra......tional('-123.456').truncate(+1) # => (-617/5)
Rational('-123.456').truncate(+1).to_f # => -123.4
Rational('-123.456').truncate(0) # => -123
Rational('-123.456').truncate(-1) # => -120
//}
@see Rational#ceil, Rational#floor... -
Thread
# status -> String | false | nil (6123.0) -
生きているスレッドの状態を文字列 "run"、"sleep", "aborting" のいず れかで返します。正常終了したスレッドに対して false、例外によ り終了したスレッドに対して nil を返します。
...生きているスレッドの状態を文字列 "run"、"sleep", "aborting" のいず
れかで返します。正常終了したスレッドに対して false、例外によ
り終了したスレッドに対して nil を返します。
Thread#alive? が真を返すなら、このメソッドも......hread.new { sleep }
d.kill #=> #<Thread:0x401b3678 aborting>
a.status #=> nil
b.status #=> "sleep"
c.status #=> false
d.status #=> "aborting"
Thread.current.status #=> "run"
@see Thread#alive?, Thread#stop?...