クラス
- Array (558)
- Complex (11)
- Date (22)
- Enumerator (11)
- Float (19)
- Integer (33)
- Module (66)
- Object (22)
-
OpenSSL
:: BN (44) - OpenStruct (11)
- Range (194)
- Rational (55)
- Regexp (11)
-
Socket
:: AncillaryData (33) -
Socket
:: Option (33) - String (11)
- UnboundMethod (11)
モジュール
- Enumerable (132)
キーワード
- & (11)
- * (22)
- ** (11)
- + (22)
- - (22)
- < (11)
- <= (11)
- <=> (11)
- =~ (22)
- >= (11)
- [] (33)
- at (11)
- begin (11)
- bind (11)
- bool (11)
- bsearch (44)
- ceil (11)
- cmp (11)
- coerce (22)
- combination (22)
- cycle (22)
-
define
_ method (22) -
delete
_ at (11) - dig (9)
- each (22)
- end (11)
- feed (11)
- fetch (33)
- first (44)
- flatten (11)
- flatten! (11)
- floor (11)
-
initialize
_ copy (11) - insert (11)
- int (22)
- intersection (5)
-
ip
_ pktinfo (11) - join (11)
- last (44)
- linger (11)
- max (86)
- min (86)
- modifiable (11)
- permutation (22)
- pop (22)
- pow (22)
-
repeated
_ combination (22) -
repeated
_ permutation (22) - replace (11)
- rotate (11)
- rotate! (11)
- round (30)
- sample (44)
- shift (22)
-
singleton
_ class (11) - sort (22)
- sum (38)
-
to
_ i (11) - transpose (11)
- truncate (11)
- ucmp (11)
-
unix
_ rights (11) - zip (22)
- | (11)
検索結果
先頭5件
-
Module
# >(other) -> bool | nil (18143.0) -
比較演算子。 self が other の先祖である場合、true を返します。 self が other の子孫か同一クラスである場合、false を返します。
...@raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Awesome; end
module Included
include Awesome
end
module Prepended
prepend Awesome
end
Included.ancestors # => [Included, Awesome]
Awesome > Included # => true......Included > Awesome # => false
Prepended.ancestors # => [Awesome, Prepended]
Awesome > Prepended # => true
Prepended > Awesome # => false
Awesome > Awesome # => false
Awesome > Object # => nil
//}... -
Module
# >=(other) -> bool | nil (6107.0) -
比較演算子。self が other の先祖か同一クラスである場合、 true を返します。 self が other の子孫である場合、false を返します。
...raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo >= Bar # => true
Bar >= Foo # => false
Baz.ancestors # => [Fo......o, Baz]
Foo >= Baz # => true
Baz >= Foo # => false
Foo >= Foo # => true
Foo >= Object # => nil
//}... -
OpenSSL
:: BN # <=>(other) -> -1 | 0 | 1 (6107.0) -
自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。
...require 'openssl'
OpenSSL::BN.new(5) <=> 5 # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}
@param other 比較する整数
@raise TypeError 比較できないときに発生し... -
OpenSSL
:: BN # cmp(other) -> -1 | 0 | 1 (3107.0) -
自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。
...require 'openssl'
OpenSSL::BN.new(5) <=> 5 # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}
@param other 比較する整数
@raise TypeError 比較できないときに発生し... -
UnboundMethod
# bind(obj) -> Method (137.0) -
self を obj にバインドした Method オブジェクトを生成して返します。
...@raise TypeError objがbindできないオブジェクトである場合に発生します
//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class Foo
def foo
"foo"
end
end
# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # => #<Unbo......Foo#foo>
# Foo のインスタンスをレシーバとする Method オブジェクトを生成
p m.bind(Foo.new) # => #<Method: Foo#foo>
# Foo のサブクラス Bar のインスタンスをレシーバとする Method
class Bar < Foo
end
p m.bind(Bar.new) # => #<Meth......od: Bar(Foo)#foo>
# モジュールのインスタンスメソッドの UnboundMethod の場合
module Foo
def foo
"foo"
end
end
# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # => #<UnboundMethod: Foo#foo>
# Foo をインクルードしたクラス Bar のインスタン... -
Object
# initialize _ copy(obj) -> object (125.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...を返すだけのメソッドです。
initialize_copy という名前のメソッドは
自動的に private に設定されます。
@raise TypeError レシーバが freeze されているか、obj のクラスがレシーバ
のクラスと異なる場合に発生します。
@see Object#cl......)
#=> instance variables: #<Object:0x4019c9d4>
# tainted?: false
# singleton methods: #<NoMethodError: ...>
check obj.dup
#=> instance variables: #<Object:0x4019c9c0 @foo=1>
# tainted?: true
# singleton methods: #<NoMethodError: ...>
check obj.......clone
#=> instance variables: #<Object:0x4019c880 @foo=1>
# tainted?: true
# singleton methods: :bar
//}......=> instance variables: #<Object:0x4019c9d4>
# singleton methods: #<NoMethodError: ...>
check obj.dup
#=> instance variables: #<Object:0x4019c9c0 @foo=1>
# singleton methods: #<NoMethodError: ...>
check obj.clone
#=> instance variables: #<Object:0x4019c880 @foo=1>... -
Socket
:: AncillaryData # unix _ rights -> [IO] | nil (125.0) -
Unix domain socket の SCM_RIGHTS 制御メッセージに含まれる ファイルディスクリプタを IO オブジェクトの配列として返します。
...cket です。
この配列は Socket::AncillaryData が初期化されたときに
作られます。例えば BasicSocket#recvmsg を :scm_rights => true
オプションを付けて呼びだし、
SCM_RIGHTS な 制御メッセージを受け取ったときに配列が作られます。
適切......eeds :scm_rights=>true for unix_rights
s1, s2 = UNIXSocket.pair
p s1 #=> #<UNIXSocket:fd 3>
s1.sendmsg "stdin and a socket", 0, nil, Socket::AncillaryData.unix_rights(STDIN, s1)
_, _, _, ctl = s2.recvmsg(:scm_rights=>true)
p ctl
#=> #<Socket::Ancil......laryData: UNIX SOCKET RIGHTS 6 7>
p ctl.unix_rights #=> [#<IO:fd 6>, #<Socket:fd 7>]
p File.identical?(STDIN, ctl.unix_rights[0]) #=> true
p File.identical?(s1, ctl.unix_rights[1]) #=> true
# If :scm_rights=>true is not given, unix_rights returns nil
s1, s2... -
Enumerable
# max {|a , b| . . . } -> object | nil (119.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...ブロックの値は、a > b のとき正、
a == b のとき 0、a < b のとき負の整数を、期待しています。
該当する要素が複数存在する場合、どの要素を返すかは不定です。
@param n 取得する要素数。
@raise TypeError ブロックが整数以......{ |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person:0x007fc54b0240a0 @name="sato", @age=55>
people.max(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fc54b0240a0 @name="sato", @age=55>, #<Person:0x007fc54c033ea0 @name="suzuki", @age=55>]
//}... -
Enumerable
# max(n) {|a , b| . . . } -> Array (119.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...ブロックの値は、a > b のとき正、
a == b のとき 0、a < b のとき負の整数を、期待しています。
該当する要素が複数存在する場合、どの要素を返すかは不定です。
@param n 取得する要素数。
@raise TypeError ブロックが整数以......{ |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person:0x007fc54b0240a0 @name="sato", @age=55>
people.max(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fc54b0240a0 @name="sato", @age=55>, #<Person:0x007fc54c033ea0 @name="suzuki", @age=55>]
//}... -
Enumerable
# min {|a , b| . . . } -> object | nil (119.0) -
ブロックの評価結果で各要素の大小判定を行い、最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...要素が存在しなければ nil を返します。
引数を指定する形式では、空の配列を返します。
ブロックの値は、a > b のとき正、a == b のとき 0、
a < b のとき負の整数を、期待しています。
該当する要素が複数存在する場合、ど......| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person:0x007fd6f0824190 @name="tanaka", @age=11>
people.min(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fb5899ef4a8 @name="tanaka", @age=11>, #<Person:0x007fb5899ef728 @name="suzuki", @age=11>]
//}
@ra...