別のキーワード
クラス
-
ARGF
. class (12) - Array (326)
- BasicObject (72)
- Class (12)
- Complex (48)
- Data (9)
-
Encoding
:: Converter (48) - Enumerator (72)
-
Enumerator
:: Lazy (120) -
Enumerator
:: Yielder (12) - Exception (12)
- Fiber (20)
- File (12)
- Float (54)
- Hash (102)
- IO (32)
- Integer (72)
- MatchData (12)
- Method (82)
- Module (264)
- Numeric (60)
- Object (216)
- Proc (116)
- Range (31)
- Rational (24)
- Refinement (4)
- Regexp (24)
- String (295)
- Struct (26)
- Symbol (12)
- Time (38)
- UnboundMethod (24)
モジュール
- Enumerable (356)
キーワード
- ! (12)
- % (26)
- ** (48)
- + (12)
- << (14)
- === (32)
- >> (14)
- [] (24)
-
_ _ id _ _ (12) -
_ _ send _ _ (24) - advise (12)
-
alias
_ method (12) - alive? (4)
- append (8)
-
append
_ as _ bytes (1) - arity (36)
- attr (12)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) - backtrace (12)
-
bind
_ call (12) - binmode (12)
- bsearch (48)
- call (36)
- capitalize (9)
- capitalize! (9)
- chain (7)
- chunk (12)
-
class
_ exec (12) - collect (48)
- collect! (24)
-
collect
_ concat (36) - concat (18)
- count (12)
- crypt (12)
- curry (24)
-
deconstruct
_ keys (2) - delete (12)
- delete! (12)
-
deprecate
_ constant (12) - difference (7)
- div (12)
- divmod (24)
- downcase (9)
- downcase! (9)
- each (48)
-
each
_ with _ index (24) -
each
_ with _ object (24) - encode (36)
-
end
_ with? (18) - entries (12)
-
enum
_ for (48) - except (4)
- extend (12)
-
fetch
_ values (2) -
filter
_ map (18) -
flat
_ map (36) - flock (12)
- force (12)
-
grep
_ v (24) -
import
_ methods (4) - include (12)
- initialize (12)
- insert (12)
- inspect (12)
-
instance
_ exec (12) - intersection (6)
- lazy (12)
- map (48)
- map! (24)
- match (24)
-
max
_ by (48) - merge (14)
- merge! (14)
-
method
_ missing (12) -
module
_ exec (12) -
module
_ function (12) - modulo (12)
- new (12)
- overlap? (2)
- pack (21)
- parameters (24)
- pow (24)
- prepend (29)
-
primitive
_ convert (48) - print (12)
- private (12)
-
private
_ class _ method (12) -
private
_ constant (12) - product (24)
- public (12)
-
public
_ class _ method (12) -
public
_ constant (12) -
public
_ send (24) - push (12)
- refine (12)
- remainder (12)
-
remove
_ method (12) -
respond
_ to _ missing? (12) - resume (12)
- round (30)
-
ruby2
_ keywords (18) - send (24)
- slice (8)
- squeeze (12)
- squeeze! (12)
-
start
_ with? (18) - step (3)
- strftime (12)
- sum (42)
- swapcase (9)
- swapcase! (9)
- tap (12)
-
to
_ a (24) -
to
_ ary (12) -
to
_ c (12) -
to
_ enum (48) -
to
_ f (24) -
to
_ h (39) -
to
_ hash (12) -
to
_ int (12) -
to
_ r (12) -
to
_ regexp (12) -
to
_ s (12) -
to
_ set (6) -
to
_ str (12) - transfer (4)
-
transform
_ values (18) -
transform
_ values! (18) -
undef
_ method (12) - union (7)
- unpack (12)
- unshift (12)
- upcase (9)
- upcase! (9)
- update (14)
- using (12)
-
values
_ at (48) - with (3)
-
with
_ index (18) -
with
_ object (12) - write (8)
- yield (24)
- zip (72)
検索結果
先頭5件
-
Rational
# *(other) -> Rational | Float (18139.0) -
積を計算します。
...。
@param other 自身に掛ける数
other に Float を指定した場合は、計算結果を Float で返しま
す。
//emlist[例][ruby]{
r = Rational(3, 4)
r * 2 # => (3/2)
r * 4 # => (3/1)
r * 0.5 # => 0.375
r * Rational(1, 2) # => (3/8)
//}... -
Complex
# *(other) -> Complex (18133.0) -
積を計算します。
...積を計算します。
@param other 自身に掛ける数
//emlist[例][ruby]{
Complex(1, 2) * 2 # => (2+4i)
Complex(1, 2) * Complex(2, 3) # => (-4+7i)
Complex(1, 2) * Rational(1, 2) # => ((1/2)+(1/1)*i)
//}... -
String
# *(times) -> String (18133.0) -
文字列の内容を times 回だけ繰り返した新しい文字列を作成して返します。
...self を times 回繰り返した新しい文字列
@raise ArgumentError 引数に負数を指定したときに発生します。
//emlist[例][ruby]{
p "str" * 3 # => "strstrstr"
str = "abc"
p str * 4 # => "abcabcabcabc"
p str * 0 # => ""
p str # => "abc" (変化なし)
//}... -
Array
# *(sep) -> String (18124.0) -
指定された sep を間にはさんで連結した文字列を生成して返します。Array#join(sep) と同じ動作をします。
...ep) と同じ動作をします。
@param sep 文字列を指定します。
文字列以外のオブジェクトを指定した場合は to_str メソッドによ
る暗黙の型変換を試みます。
//emlist[例][ruby]{
p [1,2,3] * ","
# => "1,2,3"
//}
@see Array#join... -
Array
# *(times) -> Array (18124.0) -
配列の内容を times 回 繰り返した新しい配列を作成して返します。 値はコピーされないことに注意してください。
...or 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError 引数に負の数を指定した場合に発生します。
//emlist[例][ruby]{
p [1, 2, 3] * 3 #=> [1, 2, 3, 1, 2, 3, 1, 2, 3]
//}... -
Float
# *(other) -> Float (18121.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
//emlist[例][ruby]{
# 積
2.4 * 3 # => 7.2
//}... -
Integer
# *(other) -> Numeric (18121.0) -
算術演算子。積を計算します。
...算術演算子。積を計算します。
@param other 二項演算の右側の引数(対象)
@return 計算結果
//emlist[][ruby]{
2 * 3 # => 6
//}... -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (12277.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.
...d 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 ar......ate 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 versions
before 2.7, check that the module responds to this method befo......aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.
//emlist[例][ruby]{
module Mod
def foo(meth, *args, &block)
send(:"do_#{meth}", *args, &block)
end
ruby2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end
//}... -
Proc
# ruby2 _ keywords -> proc (12277.0) -
Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc 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 proc to other methods.
...Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked......ate 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 versions
before 2.7, check that the proc responds to this method before......so, be aware that if this method is removed, the behavior of the
proc will change so that it does not pass through keywords.
//emlist[][ruby]{
module Mod
foo = ->(meth, *args, &block) do
send(:"do_#{meth}", *args, &block)
end
foo.ruby2_keywords if foo.respond_to?(:ruby2_keywords)
end
//}...