るりまサーチ

最速Rubyリファレンスマニュアル検索!
1277件ヒット [1-100件を表示] (0.121秒)

別のキーワード

  1. _builtin typeerror
  2. sort typeerror
  3. dump typeerror
  4. $@ typeerror
  5. $~ typeerror

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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...

絞り込み条件を変える

<< 1 2 3 ... > >>