るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

TrueClass#&(other) -> bool (24355.0)

other が真なら true を, 偽なら false を返します。

...other が真なら true を, 偽なら false を返します。

@param other 論理積を行なう式です。

&
は再定義可能な演算子に分類されていますので、通常は true & other のように使われます。

//emlist[例][ruby]{
p true & true #=> true
p true & false...
...#=> false
p true & nil #=> false
p true & (1 == 1) #=> true
p true & (1 + 1) #=> true

p true.&(true) #=> true
p true.&(false) #=> false
p true.&(nil) #=> false
p true.&(1 == 1) #=> true
p true.&(1 + 1) #=> true
//}...

Integer#&(other) -> Integer (24325.0)

ビット二項演算子。論理積を計算します。

...ビット二項演算子。論理積を計算します。

@param other 数値

//emlist[][ruby]{
1 & 1 # => 1
2 & 3 # => 2
//}...

Array#&(other) -> Array (21319.0)

集合の積演算です。両方の配列に含まれる要素からなる新しい配列を返 します。重複する要素は取り除かれます。

...の重複判定は、Object#eql? により行われます。

新しい配列における要素の順は self における要素の順と同じです。

@param other 配列を指定します。
配列以外のオブジェクトを指定した場合は to_ary メソッドによ...
...る暗黙の型変換を試みます。

@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 1, 2, 3] & [3, 1, 4] #=> [1, 3]
//}

@see Array#|...
...る暗黙の型変換を試みます。

@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 1, 2, 3] & [3, 1, 4] #=> [1, 3]
//}

@see Array#|, Array#intersection...

Module#ruby2_keywords(method_name, ...) -> nil (18475.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments...
...argument is marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through th...
...ethod to
other methods.

T
his should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

T
his method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby...

FalseClass#&(other) -> false (18355.0)

常に false を返します。

...

@param other 論理積を行なう式です。

&
は再定義可能な演算子に分類されていますので、通常は false & other の形で使われます。

//emlist[例][ruby]{
p false & true #=> false
p false & false #=> false
p false & nil #=> false
p false & (1 == 1)...
...#=> false
p false & (1 + 1) #=> false

p false.&(true) #=> false
p false.&(false) #=> false
p false.&(nil) #=> false
p false.&(1 == 1) #=> false
p false.&(1 + 1) #=> false
//}...

絞り込み条件を変える

NilClass#&(other) -> false (18337.0)

常に false を返します。

...常に false を返します。

@param other 論理積を行なう式です

//emlist[例][ruby]{
nil & true # => false
nil & false # => false
nil & nil # => false
nil & "a" # => false
//}...

TSort#tsort -> Array (18219.0)

頂点をトポロジカルソートして得られる配列を返します。 この配列は子から親に向かってソートされています。 すなわち、最初の要素は子を持たず、最後の要素は親を持ちません。

...@raise TSort::Cyclic 閉路が存在するとき、発生します。

//emlist[使用例][ruby]{
r
equire 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

sorted = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort...
...p sorted #=> [3, 2, 1, 4]
//}

@see TSort.tsort...

TSort#tsort_each -> Enumerator (18219.0)

TSort#tsort メソッドのイテレータ版です。 obj.tsort_each は obj.tsort.each と似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。

...
T
Sort#tsort メソッドのイテレータ版です。
obj.tsort_each は obj.tsort.each と似ていますが、
ブロックの評価中に obj が変更された場合は予期しない結果になる
ことがあります。

t
sort_each は nil を返します。
閉路が存在するとき、...
... TSort::Cyclic を起こします。

@raise TSort::Cyclic 閉路が存在するとき、発生します.

//emlist[使用例][ruby]{
r
equire 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {...
...1=>[2, 3], 2=>[3], 3=>[], 4=>[]}

non_sort.tsort_each {|node|
non_sort.tsort_each_child(node){|child|
printf("%d -> %d\n", node, child)
}
}

# 出力
#=> 2 -> 3
#=> 1 -> 2
#=> 1 -> 3
//}

@see TSort.tsort_each...

TSort#tsort_each {|node| ...} -> nil (18219.0)

TSort#tsort メソッドのイテレータ版です。 obj.tsort_each は obj.tsort.each と似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。

...
T
Sort#tsort メソッドのイテレータ版です。
obj.tsort_each は obj.tsort.each と似ていますが、
ブロックの評価中に obj が変更された場合は予期しない結果になる
ことがあります。

t
sort_each は nil を返します。
閉路が存在するとき、...
... TSort::Cyclic を起こします。

@raise TSort::Cyclic 閉路が存在するとき、発生します.

//emlist[使用例][ruby]{
r
equire 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {...
...1=>[2, 3], 2=>[3], 3=>[], 4=>[]}

non_sort.tsort_each {|node|
non_sort.tsort_each_child(node){|child|
printf("%d -> %d\n", node, child)
}
}

# 出力
#=> 2 -> 3
#=> 1 -> 2
#=> 1 -> 3
//}

@see TSort.tsort_each...
<< 1 2 3 ... > >>