354件ヒット
[1-100件を表示]
(0.084秒)
別のキーワード
種類
- インスタンスメソッド (225)
- 定数 (60)
- ライブラリ (36)
- 文書 (21)
- クラス (12)
ライブラリ
- ビルトイン (69)
-
net
/ ftp (24) - openssl (12)
- optparse (72)
- pstore (12)
-
rubygems
/ command (12) -
rubygems
/ package (12) -
rubygems
/ package / tar _ header (24) -
rubygems
/ package / tar _ input (12) -
rubygems
/ specification (24) - socket (24)
クラス
- Array (9)
- Fiber (12)
-
Gem
:: Command (12) -
Gem
:: Package :: TarHeader (24) -
Gem
:: Package :: TarInput (12) -
Gem
:: Specification (24) -
Net
:: FTP (24) - Object (12)
- OptionParser (72)
- PStore (12)
- Proc (24)
- Socket (12)
モジュール
- Enumerable (12)
-
OpenSSL
:: SSL (12) -
Socket
:: Constants (12)
キーワード
- BadCheckSum (12)
- DATA (12)
-
EMPTY
_ MARSHAL _ CHECKSUM (12) -
IPV6
_ CHECKSUM (24) -
NEWS for Ruby 2
. 4 . 0 (9) -
OP
_ NO _ SESSION _ RESUMPTION _ ON _ RENEGOTIATION (12) - bigdecimal (12)
- checksum (12)
- curry (24)
-
extract
_ entry (12) -
fiddle
/ import (12) - resume (24)
- resume= (12)
-
rinda
/ rinda (12) - summarize (24)
- summary (12)
- summary= (24)
-
summary
_ indent (12) -
summary
_ indent= (12) -
summary
_ width (12) -
summary
_ width= (12) -
update
_ checksum (12) - メソッド呼び出し(super・ブロック付き・yield) (12)
検索結果
先頭5件
-
Array
# sum(init=0) {|e| expr } -> object (18290.0) -
要素の合計を返します。例えば [e1, e2, e3].sum は init + e1 + e2 + e3 を返します。
...[e1, e2, e3].sum は init + e1 + e2 + e3 を返します。
ブロックが与えられた場合、加算する前に各要素にブロックが適用されます。
配列が空の場合、initを返します。
//emlist[例][ruby]{
[].sum #=> 0
[].sum(0.0)......0.0
[1, 2, 3].sum #=> 6
[3, 5.5].sum #=> 8.5
[2.5, 3.0].sum(0.0) {|e| e * e } #=> 15.25
[Object.new].sum #=> TypeError
//}
配列の平均値は以下のように求められます。
//emlist[例][ruby]{
mean = ary.sum(0.0) / ary.len......使えます。
//emlist[例][ruby]{
["a", "b", "c"].sum("") #=> "abc"
[[1], [[2]], [3]].sum([]) #=> [1, [2], 3]
//}
しかし、文字列の配列や配列の配列の場合 Array#join や Array#flatten の方が Array#sum よりも高速です。
//emlist[例][ruby]{
["a", "... -
Enumerable
# sum(init=0) {|e| expr } -> object (18256.0) -
要素の合計を返します。
...返します。
//emlist[例][ruby]{
{ 1 => 10, 2 => 20 }.sum {|k, v| k * v } # => 50
(1..10).sum # => 55
(1..10).sum {|v| v * 2 } # => 110
('a'..'z').sum # => TypeError
//}
init 引数を明示的に指名すると数値......list[例][ruby]{
{ 1 => 10, 2 => 20 }.sum([]) #=> [1, 10, 2, 20]
"a\nb\nc".each_line.lazy.map(&:chomp).sum("") #=> "abc"
[[1], [[2]], [3]].sum([]) #=> [1, [2], 3]
//}
"+" メソッドが再定義されている場合、Enumerable#sum は再定義を無視することが......あります(例えばInteger#+)。
@see Array#sum... -
Gem
:: Package :: TarHeader # update _ checksum (12200.0) -
チェックサムを更新します。
チェックサムを更新します。 -
OpenSSL
:: SSL :: OP _ NO _ SESSION _ RESUMPTION _ ON _ RENEGOTIATION -> Integer (12200.0) -
セッション再ネゴシエーションをした場合にサーバ側で 常に新しいセッションを生成するフラグです。
...セッション再ネゴシエーションをした場合にサーバ側で
常に新しいセッションを生成するフラグです。
OpenSSL::SSL::SSLContext#options= で利用します。... -
PStore
:: EMPTY _ MARSHAL _ CHECKSUM -> String (12200.0) -
内部で利用する定数です。
内部で利用する定数です。 -
Socket
:: Constants :: IPV6 _ CHECKSUM -> Integer (12200.0) -
Byte offset into a packet where the checksum is located. BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。
...Byte offset into a packet where the checksum is located.
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。
@see Socket::Constants::IPPROTO_IPV6,
ip6(4freebsd),
3542... -
Socket
:: IPV6 _ CHECKSUM -> Integer (12200.0) -
Byte offset into a packet where the checksum is located. BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。
...Byte offset into a packet where the checksum is located.
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。
@see Socket::Constants::IPPROTO_IPV6,
ip6(4freebsd),
3542... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () (9300.0) -
サマリを指定された to へと加えていきます。
...ません。
@param to サマリを出力するオブジェクトを指定します。to には << メソッドが定義されいる必要があります。
@param width サマリの幅を整数で指定します。
@param max サマリの最大幅を整数で指定します。
@param indent サ......equire "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, " ")
# => ["description\n",......" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (9300.0) -
サマリを指定された to へと加えていきます。
...ません。
@param to サマリを出力するオブジェクトを指定します。to には << メソッドが定義されいる必要があります。
@param width サマリの幅を整数で指定します。
@param max サマリの最大幅を整数で指定します。
@param indent サ......equire "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, " ")
# => ["description\n",......" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}...