78件ヒット
[1-78件を表示]
(0.021秒)
別のキーワード
種類
- インスタンスメソッド (42)
- 文書 (25)
- 関数 (11)
ライブラリ
- ビルトイン (42)
クラス
- Method (31)
- UnboundMethod (11)
キーワード
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 3
. 0 . 0 (4) - Ruby用語集 (11)
- curry (20)
-
method
_ arity (11)
検索結果
先頭5件
-
Method
# arity -> Integer (39221.0) -
メソッドが受け付ける引数の数を返します。
...ew
p c.method(:u).arity #=> 0
p c.method(:v).arity #=> 1
p c.method(:w).arity #=> -1
p c.method(:x).arity #=> 2
p c.method(:y).arity #=> -3
p c.method(:z).arity #=> -3
s = "xyz"
s.method(:size).arity #=> 0
s.method(:replace).arity #=> 1
s.method(:squeeze).arity #=>......-1
s.method(:count).arity #=> -1
//}... -
UnboundMethod
# arity -> Integer (21221.0) -
メソッドが受け付ける引数の数を返します。
...C.instance_method(:one).arity #=> 0
p C.instance_method(:two).arity #=> 1
p C.instance_method(:three).arity #=> -1
p C.instance_method(:four).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3
String.instance_method(:size).arity #=>......0
String.instance_method(:replace).arity #=> 1
String.instance_method(:squeeze).arity #=> -1
String.instance_method(:count).arity #=> -1
//}... -
Method
# curry(arity) -> Proc (21119.0) -
self を元にカリー化した Proc を返します。
...返します。
@param arity 引数の個数を指定します。可変長の引数を指定できるメソッドを
カリー化する際には必ず指定する必要があります。
//emlist[例][ruby]{
def foo(a,b,c)
[a, b, c]
end
proc = self.method(:foo).curry
proc2 = proc.......call(1, 2) #=> #<Proc>
proc2.call(3) #=> [1,2,3]
def vararg(*args)
args
end
proc = self.method(:vararg).curry(4)
proc2 = proc.call(:x) #=> #<Proc>
proc3 = proc2.call(:y, :z) #=> #<Proc>
proc3.call(:a) #=> [:x, :y, :z, :a]
//}
@see Proc#curry... -
Method
# curry -> Proc (21019.0) -
self を元にカリー化した Proc を返します。
...返します。
@param arity 引数の個数を指定します。可変長の引数を指定できるメソッドを
カリー化する際には必ず指定する必要があります。
//emlist[例][ruby]{
def foo(a,b,c)
[a, b, c]
end
proc = self.method(:foo).curry
proc2 = proc.......call(1, 2) #=> #<Proc>
proc2.call(3) #=> [1,2,3]
def vararg(*args)
args
end
proc = self.method(:vararg).curry(4)
proc2 = proc.call(:x) #=> #<Proc>
proc3 = proc2.call(:y, :z) #=> #<Proc>
proc3.call(:a) #=> [:x, :y, :z, :a]
//}
@see Proc#curry... -
static VALUE method
_ arity(VALUE method) (12300.0) -
-
NEWS for Ruby 3
. 0 . 0 (138.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern......e, String => x, String => y, *post]
p pre #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p post #=> [2, "d", "e", "f", 3]
end
//}
* Endless method definition is added. [EXPERIMENTAL]
16746
//emlist{
def square(x) = x * x
//}
* Interpolated String literals are no longer frozen when......PERIMENTAL: Hash#each consistently yields a 2-element array. 12706
* Now `{ a: 1 }.each(&->(k, v) { })` raises an ArgumentError due to lambda's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` con... -
Ruby用語集 (108.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...リティー
: arity
メソッドやそれをオブジェクト化した Method オブジェクトの仮引数の数、および
ブロックやそれをオブジェクト化した Proc オブジェクトの
ブロックパラメーターの数。
Method#arity や Proc#arity で得ること......間接的に参照・代入できる。
→アクセッサー
参照:d:spec/variables#instance
: インスタンスメソッド
: instance method
クラスやモジュールに定義されるメソッドは、定義方法により、そのクラスや
モジュール自身をレシー......。戻り値ともいう。
また、式の評価値のことを式の返り値と呼ぶこともある。
: 可視性(メソッドの)
: method visibility
メソッドの呼び出し可能性。Ruby のメソッド可視性は public、private、protected の
三種類があるが、Jav... -
NEWS for Ruby 2
. 2 . 0 (36.0) -
NEWS for Ruby 2.2.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...くのシンボルがGC可能になりました
* Method
* 追加: Method#curry([arity]) はカリー化された Proc オブジェクトを返します
* 追加: Method#super_method はスーパクラスの同名のメソッドの Method オブジェクトを返します。
=== 組み...