るりまサーチ

最速Rubyリファレンスマニュアル検索!
72件ヒット [1-72件を表示] (0.017秒)
トップページ > クエリ:*[x] > クエリ:delegate[x]

別のキーワード

  1. _builtin *
  2. matrix *
  3. vector *
  4. bigdecimal *
  5. array *

ライブラリ

クラス

検索結果

delegate (38006.0)

メソッドの委譲 (delegation) を行うためのライブラリです。

...の実行を委譲します。


Kernel#DelegateClass は 引数で渡されたクラスのインスタンスをひとつとり、
そのオブジェクトにインスタンスメソッドを委譲するクラスを定義して返します。

=== 参考

*
Rubyist Magazine - 標準添付ライブ...

Delegator#method_missing(m, *args) -> object (8101.0)

渡されたメソッド名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。

渡されたメソッド名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。

@param m メソッドの名前(シンボル)

@param args メソッドに渡された引数

@return 委譲先のメソッドからの返り値

@see BasicObject#method_missing

NEWS for Ruby 2.7.0 (1512.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...== 2.6.0 以降の変更

=== 言語仕様の変更

==== パターンマッチ

*
パターンマッチが実験的機能として導入されました。 14912

//emlist[][ruby]{
case [0, [1, 2, 3]]
in [a, [b, *c]]
p a #=> 0
p b #=> 1
p c #=> [2, 3]
end
//}

//emlist[][ruby]{
case {a: 0,...
...}]}
#=> NoMatchingPatternError
//}

*
詳細は https://speakerdeck.com/k_tsj/pattern-matching-new-feature-in-ruby-2-dot-7 のスライドを参照してください。
*
スライドは少し古い内容になっていることに注意してください。

*
パターンマッチに対す...
...by/ruby/pull/2226

*
CSV
*
3.1.2に更新されました。
https://github.com/ruby/csv/blob/master/NEWS.md

*
Date
*
Date.jisx0301, Date#jisx0301, Date.parseが新しい日本の年号を
サポートしました。 15742

*
Delegator
*
Object#DelegateClassがブロッ...

ruby 1.8.3 feature (138.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...ruby 1.8.3 feature
*
((<ruby 1.8 feature>))
*
((<ruby 1.8.2 feature>))

ruby 1.8.2 から ruby 1.8.3 までの変更点です。

掲載方針

*
バグ修正の影響も含めて動作が変わるものを収録する。
*
単にバグを直しただけのものは収録しない。
*
ライブラリ...
...主観))

*
カテゴリ
*
[ruby]: ruby インタプリタの変更
*
[api]: 拡張ライブラリ API
*
[lib]: ライブラリ
*
レベル
*
[bug]: バグ修正
*
[new]: 追加されたクラス/メソッドなど
*
[compat]: 変更されたクラス/メソッドなど
*
互換...
...def foo.bar
puts "bar"
end
foo2.bar

$ ruby-1.8.2 -r delegate test_dlg.rb
test_dlg.rb:6: undefined method `bar' for #<Object:0x4021b0a0> (NoMethodError)

$ ruby-1.8.3 -r delegate test_dlg.rb
bar

=== 2005-06-20
: DBM#closed? [lib] [new]
: GDBM#closed? [li...

Ruby用語集 (42.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...ッシュに呼び出しを丸投げすることで実装が簡素化できる。

標準添付ライブラリーには、委譲を支援する delegate
forwardable がある。

: イテレーター
: iterator
一般には繰り返し(反復)を抽象化する仕組み全般を指す...
...str.size」「user&.name」といったメソッド呼び出しにおける
「.」「&.」も演算子である。
「[*0..9]」におけるいわゆる splat 展開の * や、
Proc オブジェクトをブロックとして渡す「strs.map(&:length)」に
おける & も演算子であ...
...ある。

→ refinement

: オペランド
: operand
演算子式において演算の対象となる式。式 a + b * c において、+ の
オペランドは a と b * c の二つである。

被演算子ともいう。

Ruby の演算子式の中にはメソッド呼び出しに還...

絞り込み条件を変える

Module#ruby2_keywords(method_name, ...) -> nil (18.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...
...s interpreted as
keywords. In other words, keywords will be passed through the method 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 po...
...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 (18.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...
...t is interpreted as keywords. In other words, keywords will
be passed through the proc to other methods.

This should only be used for procs 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 po...
...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
//}...