るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.016秒)
トップページ > クラス:Module[x] > クエリ:send[x] > バージョン:3.3[x]

別のキーワード

  1. socket send
  2. udpsocket send
  3. socket msg_send
  4. object send
  5. _builtin send

ライブラリ

キーワード

検索結果

Module#append_features(module_or_class) -> self (40.0)

モジュール(あるいはクラス)に self の機能を追加します。

...ラス)に self の機能を追加します。

このメソッドは Module#include の実体であり、
include を Ruby で書くと以下のように定義できます。

//emlist[例][ruby]{
def include(*modules)
module
s.reverse_each do |mod|
# append_features や included はプライ...
...ベートメソッドなので
# 直接 mod.append_features(self) などとは書けない
mod.__send__(:append_features, self)
mod.__send__(:included, self)
end
end
//}

@see Module#included...

Module#extend_object(obj) -> object (40.0)

Object#extend の実体です。オブジェクトにモジュールの機能を追加します。

...機能を追加します。

Object#extend は、Ruby で書くと以下のように定義できます。

//emlist[例][ruby]{
def extend(*modules)
module
s.reverse_each do |mod|
# extend_object や extended はプライベートメソッドなので
# 直接 mod.extend_object(self) など...
...では、self に定義されて
いるインスタンスメソッドを obj の特異メソッドとして追加します。

@param obj self の機能を追加するオブジェクトを指定します。

@return obj で指定されたオブジェクトを返します。

@see Module#extended...

Module#ruby2_keywords(method_name, ...) -> nil (22.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.

...st in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be 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(:...