るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

Module#instance_methods(inherited_too = true) -> [Symbol] (42541.0)

そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。

そのモジュールで定義されている public および protected メソッド名
の一覧を配列で返します。

@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。

@see Object#methods

//emlist[例1][ruby]{
class Foo
private; def private_foo() end
protected; def protected_foo() end
public; def public_foo() end
end

# あるクラスのインスタンス...

Module#private_instance_methods(inherited_too = true) -> [Symbol] (42379.0)

そのモジュールで定義されている private メソッド名 の一覧を配列で返します。

...ュールで定義されているメソッドのみ返します。

@see Object#private_methods, Module#instance_methods

//emlist[例][ruby]{
module
Foo
def foo; end
private def bar; end
end

module
Bar
include Foo

def baz; end
private def qux; end
end

Bar.private_instance_methods # =>...

Module#protected_instance_methods(inherited_too = true) -> [Symbol] (42343.0)

そのモジュールで定義されている protected メソッド名 の一覧を配列で返します。

...そのモジュールで定義されている protected メソッド名
の一覧を配列で返します。

@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。


@see Object#protected_methods, Module#instance_methods...

Module#public_instance_methods(inherited_too = true) -> [Symbol] (42343.0)

そのモジュールで定義されている public メソッド名 の一覧を配列で返します。

...そのモジュールで定義されている public メソッド名
の一覧を配列で返します。

@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。


@see Object#public_methods, Module#instance_methods...

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

絞り込み条件を変える

Module#undef_method(*name) -> self (24076.0)

このモジュールのインスタンスメソッド name を未定義にします。

...ng または Symbol で与えられることです。

//emlist[例][ruby]{
module
M1
def foo
end
def self.moo
undef foo
end
end
M1.instance_methods false #=> ["foo"]
M1.moo
M1.instance_methods false #=> []
module
M2
def foo
end
def self.moo
undef_method :foo
end
end
M2.insta...