クラス
キーワード
- [] (24)
- allbits? (8)
- anybits? (8)
- arity (24)
- initialize (12)
- intersection (3)
- new (12)
- nobits? (8)
- pack (21)
- parameters (24)
-
ruby2
_ keywords (12) - sum (12)
-
to
_ proc (12) - unpack (12)
検索結果
先頭5件
-
TrueClass
# &(other) -> bool (21251.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 (21221.0) -
ビット二項演算子。論理積を計算します。
...ビット二項演算子。論理積を計算します。
@param other 数値
//emlist[][ruby]{
1 & 1 # => 1
2 & 3 # => 2
//}... -
Set
# &(enum) -> Set (21215.0) -
共通部分、すなわち、2つの集合のいずれにも属するすべての要素からなる 新しい集合を作ります。
...義されたオブジェクトを指定します。
@raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。
//emlist[][ruby]{
s1 = Set[10, 20, 30]
s2 = Set[10, 30, 50]
p s1 & s2 #=> #<Set: {10, 30}>
//}
@see Array#&, Array#intersection... -
FalseClass
# &(other) -> false (18251.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 (18233.0) -
常に false を返します。
...常に false を返します。
@param other 論理積を行なう式です
//emlist[例][ruby]{
nil & true # => false
nil & false # => false
nil & nil # => false
nil & "a" # => false
//}... -
Array
# &(other) -> Array (18215.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... -
Set
# intersection(enum) -> Set (9115.0) -
共通部分、すなわち、2つの集合のいずれにも属するすべての要素からなる 新しい集合を作ります。
...義されたオブジェクトを指定します。
@raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。
//emlist[][ruby]{
s1 = Set[10, 20, 30]
s2 = Set[10, 30, 50]
p s1 & s2 #=> #<Set: {10, 30}>
//}
@see Array#&, Array#intersection... -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (6246.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.
... 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, t......ent 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 meth......od to
other methods.
This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby ve... -
Object
# initialize(*args , &block) -> object (6210.0) -
ユーザ定義クラスのオブジェクト初期化メソッド。
...ません。
initialize には
Class#new に与えられた引数がそのまま渡されます。
サブクラスではこのメソッドを必要に応じて再定義されること
が期待されています。
initialize という名前のメソッドは自動的に private に設定され......。
//emlist[][ruby]{
class Foo
def initialize name
puts "initialize Foo"
@name = name
end
end
class Bar < Foo
def initialize name, pass
puts "initialize Bar"
super name
@pass = pass
end
end
it = Bar.new('myname','0500')
p it
#=> initialize Bar
# initialize Foo
# #... -
Integer
# allbits?(mask) -> bool (6131.0) -
self & mask の全てのビットが 1 なら true を返します。
...self & mask の全てのビットが 1 なら true を返します。
self & mask == mask と等価です。
@param mask ビットマスクを整数で指定します。
//emlist[][ruby]{
42.allbits?(42) # => true
0b1010_1010.allbits?(0b1000_0010) # => true
0b1010_1010.allbits?(......0b1000_0001) # => false
0b1000_0010.allbits?(0b1010_1010) # => false
//}
@see Integer#anybits?
@see Integer#nobits?... -
Integer
# anybits?(mask) -> bool (6131.0) -
self & mask のいずれかのビットが 1 なら true を返します。
...lf & mask のいずれかのビットが 1 なら true を返します。
self & mask != 0 と等価です。
@param mask ビットマスクを整数で指定します。
//emlist[][ruby]{
42.anybits?(42) # => true
0b1010_1010.anybits?(0b1000_0010) # => true
0b1010_1010.anybits?......(0b1000_0001) # => true
0b1000_0010.anybits?(0b0010_1100) # => false
//}
@see Integer#allbits?
@see Integer#nobits?...