3400件ヒット
[1-100件を表示]
(0.111秒)
ライブラリ
- ビルトイン (1588)
- benchmark (11)
- bigdecimal (11)
-
cgi
/ core (66) -
cgi
/ html (88) - continuation (22)
- csv (33)
- dbm (11)
- fiddle (22)
-
fiddle
/ import (44) - gdbm (11)
- getoptlong (11)
-
irb
/ cmd / chws (22) -
irb
/ cmd / help (11) -
irb
/ cmd / nop (11) -
irb
/ cmd / pushws (33) -
irb
/ cmd / subirb (33) -
irb
/ ext / use-loader (22) -
irb
/ output-method (66) -
json
/ add / ostruct (11) -
json
/ add / struct (11) - mathn (4)
- matrix (135)
-
minitest
/ spec (1) -
minitest
/ unit (2) - mkmf (44)
-
net
/ ftp (22) -
net
/ http (11) -
net
/ imap (33) - open-uri (22)
- openssl (209)
- optparse (55)
- pathname (22)
- psych (33)
- rake (88)
-
rdoc
/ markup (11) - resolv (44)
-
rexml
/ document (22) -
rinda
/ tuplespace (22) - rss (22)
- rubygems (11)
-
rubygems
/ command (11) -
rubygems
/ doc _ manager (11) -
rubygems
/ remote _ fetcher (11) -
rubygems
/ source _ index (22) -
rubygems
/ specification (33) -
rubygems
/ user _ interaction (99) - scanf (6)
- sdbm (11)
- set (22)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - socket (11)
- stringio (11)
- strscan (22)
- tracer (11)
- uri (11)
-
webrick
/ httpserver (11) - win32ole (11)
-
yaml
/ dbm (11) - zlib (88)
クラス
-
ARGF
. class (11) - Array (151)
- BasicSocket (11)
-
Benchmark
:: Tms (11) - BigDecimal (11)
- Bignum (6)
- CGI (11)
-
CSV
:: Row (22) -
CSV
:: Table (11) - Continuation (22)
- DBM (11)
- Data (2)
-
Encoding
:: Converter (44) - Enumerator (66)
-
Enumerator
:: Chain (12) -
Enumerator
:: Lazy (109) -
Enumerator
:: Yielder (11) - Fiber (11)
-
Fiddle
:: Closure :: BlockCaller (11) -
Fiddle
:: Function (11) - Fixnum (6)
- Float (27)
- GDBM (11)
-
Gem
:: Command (11) -
Gem
:: DocManager (11) -
Gem
:: RemoteFetcher (11) -
Gem
:: SourceIndex (22) -
Gem
:: Specification (33) -
Gem
:: StreamUI (11) - GetoptLong (11)
- Hash (55)
- IO (44)
-
IRB
:: ExtendCommand :: ChangeWorkspace (11) -
IRB
:: ExtendCommand :: CurrentWorkingWorkspace (11) -
IRB
:: ExtendCommand :: Foreground (11) -
IRB
:: ExtendCommand :: Help (11) -
IRB
:: ExtendCommand :: IrbCommand (11) -
IRB
:: ExtendCommand :: Kill (11) -
IRB
:: ExtendCommand :: Nop (11) -
IRB
:: ExtendCommand :: PopWorkspace (11) -
IRB
:: ExtendCommand :: PushWorkspace (11) -
IRB
:: ExtendCommand :: Workspaces (11) -
IRB
:: OutputMethod (55) -
IRB
:: StdioOutputMethod (11) - Integer (55)
- LocalJumpError (11)
- MatchData (11)
- Matrix (79)
- Method (11)
- Module (245)
-
Net
:: FTP (22) -
Net
:: HTTP (11) -
Net
:: IMAP (22) -
Net
:: IMAP :: UntaggedResponse (11) - Numeric (55)
- Object (89)
-
OpenSSL
:: BN (11) -
OpenSSL
:: Engine (11) -
OpenSSL
:: OCSP :: BasicResponse (11) -
OpenSSL
:: OCSP :: Request (22) -
OpenSSL
:: OCSP :: Response (11) -
OpenSSL
:: PKey :: EC :: Group (33) -
OpenSSL
:: PKey :: RSA (22) -
OpenSSL
:: X509 :: Certificate (11) -
OpenSSL
:: X509 :: Store (22) -
OpenSSL
:: X509 :: StoreContext (22) - OpenStruct (11)
- OptionParser (44)
- Pathname (22)
- Proc (27)
-
Psych
:: Handler (22) -
Psych
:: Visitors :: YAMLTree (11) -
RDoc
:: Markup (11) -
REXML
:: Document (22) -
RSS
:: Rss :: Channel :: Item :: Guid (11) -
Rake
:: Application (11) -
Rake
:: FileList (22) - Range (11)
- Rational (4)
- Refinement (3)
-
Resolv
:: DNS (44) -
Rinda
:: TupleEntry (11) -
Rinda
:: TupleSpace (11) - SDBM (11)
- Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - String (126)
- StringIO (11)
- StringScanner (22)
- Struct (34)
- Symbol (13)
-
Thread
:: Queue (9) - Time (11)
- Tracer (11)
-
URI
:: Generic (11) - UnboundMethod (21)
- Vector (56)
-
WEBrick
:: HTTPServer (11) -
WIN32OLE
_ EVENT (11) -
YAML
:: DBM (11) -
Zlib
:: Deflate (11) -
Zlib
:: GzipReader (55) -
Zlib
:: GzipWriter (22)
モジュール
-
CGI
:: HtmlExtension (88) -
CGI
:: QueryExtension (44) -
CGI
:: QueryExtension :: Value (11) - DublinCoreModel (11)
- Enumerable (341)
-
Fiddle
:: Importer (44) - FileUtils (33)
-
Gem
:: UserInteraction (88) -
IRB
:: ExtendCommandBundle (22) - Kernel (66)
-
MiniTest
:: Assertions (2) -
OpenSSL
:: Buffering (33) -
OpenURI
:: OpenRead (22) -
OptionParser
:: Arguable (11) -
Rake
:: TaskManager (11)
キーワード
- % (22)
- ** (21)
- << (11)
- [] (22)
- add (11)
-
add
_ dependency (11) -
add
_ development _ dependency (11) -
add
_ option (11) -
add
_ runtime _ dependency (11) -
add
_ specs (11) -
add
_ word _ pair (11) - alert (11)
-
alert
_ error (11) -
alert
_ warning (11) -
alias
_ method (11) - arity (22)
- ask (11)
-
ask
_ yes _ no (11) -
asn1
_ flag= (11) -
assert
_ in _ epsilon (1) -
assert
_ raises (1) - attr (11)
-
attr
_ accessor (11) -
attr
_ reader (11) -
attr
_ writer (11) - authenticate (11)
- bind (11)
-
bind
_ call (10) - bsearch (22)
- call (33)
- chain (6)
-
check
_ nonce (11) -
checkbox
_ group (22) -
choose
_ from _ list (11) - chown (18)
- chunk (11)
-
class
_ exec (11) - close (9)
- collect (50)
- collect! (23)
- collect2 (11)
-
collect
_ concat (33) - concat (8)
- count (11)
-
create
_ rule (11) -
cross
_ product (11) - curry (22)
-
dc
_ types (11) - deflate (11)
-
deprecate
_ constant (9) - div (11)
- divmod (22)
- each (78)
-
each
_ byte (11) -
each
_ line (22) -
each
_ resource (11) -
each
_ with _ index (22) -
each
_ with _ object (22) - eigen (11)
- eigensystem (11)
- encode (33)
-
end
_ with? (5) - entries (11)
-
enum
_ for (44) - exclude (11)
- execute (110)
- extend (11)
- extern (11)
-
filter
_ map (15) -
find
_ library (22) -
flat
_ map (33) - flush (11)
- force (11)
- format (11)
- gem (11)
-
get
_ proxy _ from _ env (11) - getopts (11)
- getresource (11)
- getresources (11)
-
grep
_ v (22) -
has
_ key? (11) -
import
_ methods (3) - include (22)
- include? (11)
-
irb
_ load (11) -
irb
_ require (11) - isPermaLink (11)
- key? (11)
- keys (11)
- lazy (11)
- lineno= (11)
-
load
_ gems _ in (11) - lup (11)
-
lup
_ decomposition (11) - map (50)
- map! (23)
-
max
_ by (44) -
mod
_ mul (11) -
module
_ exec (11) -
module
_ function (11) - modulo (11)
- mount (11)
- mult (11)
-
must
_ raise (1) - name (11)
- notify (11)
-
on
_ event _ with _ outargs (11) -
on
_ head (11) -
on
_ tail (11) - open (22)
-
open
_ timeout= (22) - out (11)
- pack (19)
- parse (11)
- permute (11)
-
point
_ conversion _ form (11) -
point
_ conversion _ form= (11) - pow (22)
- pp (11)
- ppx (11)
- prepend (19)
-
primitive
_ convert (44) - print (33)
- printf (11)
- printn (11)
- private (11)
-
private
_ class _ method (11) -
private
_ constant (11) - product (22)
-
progress
_ reporter (11) - protected (11)
- public (11)
-
public
_ class _ method (11) -
public
_ constant (11) -
public
_ decrypt (11) -
public
_ encrypt (11) -
public
_ key (11) -
public
_ send (22) - purpose= (22)
- push (33)
- puts (66)
-
radio
_ group (22) - read (11)
- readpartial (11)
- reason (11)
- refine (11)
- remainder (11)
-
remove
_ method (11) - renew (11)
-
respond
_ to _ missing? (11) - resume (22)
- round (27)
- ruby (11)
-
ruby2
_ keywords (10) - rule (11)
- run (11)
-
run
_ rdoc (11) -
safe
_ ln (11) - say (11)
- scalar (11)
-
scan
_ full (11) - scanf (6)
-
scrolling
_ list (22) -
search
_ full (11) - select (11)
-
set
_ default (11) - sh (11)
- shutdown (11)
- squeeze (11)
- squeeze! (11)
- start (11)
-
start
_ sequence (11) - status (22)
- strftime (11)
- struct (11)
- sum (38)
- sysread (11)
-
terminate
_ interaction (11) - timeouts= (11)
-
to
_ a (11) -
to
_ enum (44) -
to
_ h (31) -
to
_ json (22) -
to
_ set (22) -
trace
_ func (11) -
transform
_ values (16) -
transform
_ values! (16) - trust= (22)
-
try
_ run (22) -
uid
_ store (11) -
undef
_ method (11) - ungetc (11)
- union (17)
- unpack (11)
- unshift (11)
- upcase (16)
- upcase! (8)
- update (12)
- using (11)
- utime (18)
-
values
_ at (99) - verify (11)
-
with
_ index (16) -
with
_ object (11) - yield (11)
- zip (44)
検索結果
先頭5件
-
Bignum
# *(other) -> Fixnum | Bignum | Float (21301.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果... -
Fixnum
# *(other) -> Fixnum | Bignum | Float (21301.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果... -
Integer
# *(other) -> Numeric (18207.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
//emlist[][ruby]{
2 * 3 # => 6
//}... -
IRB
:: OutputMethod # puts(*objs) -> object (12201.0) -
各 obj を self に出力し、それぞれの後に改行を出力します。
各 obj を self に出力し、それぞれの後に改行を出力します。
@param objs 任意のオブジェクトを指定します。 -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (9411.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......うに、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげ... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (9411.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......うに、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげ... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (9311.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......うに、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげ... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) -> Enumerator :: Lazy (9311.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が......うに、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0......each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end
r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]
# Lazy#to_enum のおかげ... -
Bignum
# **(other) -> Fixnum | Bignum | Float (9301.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Fixnum
# **(other) -> Fixnum | Bignum | Float (9301.0) -
算術演算子。冪(べき乗)を計算します。
...算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1... -
Module
# module _ function(*name) -> Array (9201.0) -
メソッドをモジュール関数にします。
...返します。
引数なしの時は nil を返します。
@param name String または Symbol を 0 個以上指定します。
=== 注意
module_function はメソッドに「モジュール関数」という属性をつけるメ
ソッドではなく、プライベートメソッドとモジ......ジュール関数の別名は定義できません。
//emlist[例][ruby]{
module M
def foo
p "foo"
end
module_function :foo
alias bar foo
end
M.foo # => "foo"
M.bar # => undefined method `bar' for Foo:Module (NoMethodError)
//}
このコードでは、モジュール関数 foo......けるには、
以下のように、先に別名を定義してから
それぞれをモジュール関数にしなければいけません。
//emlist[例][ruby]{
module M
def foo
p "foo"
end
alias bar foo
module_function :foo, :bar
end
M.foo # => "foo"
M.bar # => "foo"
//}... -
Module
# module _ function(*name) -> self (9201.0) -
メソッドをモジュール関数にします。
...てモジュール関数です。
self を返します。
@param name String または Symbol を 0 個以上指定します。
=== 注意
module_function はメソッドに「モジュール関数」という属性をつけるメ
ソッドではなく、プライベートメソッドとモジュ......ジュール関数の別名は定義できません。
//emlist[例][ruby]{
module M
def foo
p "foo"
end
module_function :foo
alias bar foo
end
M.foo # => "foo"
M.bar # => undefined method `bar' for Foo:Module (NoMethodError)
//}
このコードでは、モジュール関数 foo......けるには、
以下のように、先に別名を定義してから
それぞれをモジュール関数にしなければいけません。
//emlist[例][ruby]{
module M
def foo
p "foo"
end
alias bar foo
module_function :foo, :bar
end
M.foo # => "foo"
M.bar # => "foo"
//}... -
Enumerable
# sum(init=0) -> object (9113.0) -
要素の合計を返します。
...selfが空の場合、initを返します。
//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 引数を明......す。
//emlist[例][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...