るりまサーチ

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

別のキーワード

  1. matrix each_with_index
  2. _builtin with_index
  3. mkmf with_werror
  4. mkmf with_config
  5. kernel with_werror

ライブラリ

キーワード

検索結果

Module#infect_with_assertions(positive_prefix, negative_prefix, skip_regexp, map = {}) -> () (6102.0)

BDD 風にテストを書くために使用するメソッド群を定義します。

BDD 風にテストを書くために使用するメソッド群を定義します。

@param positive_prefix assert の代わりのプレフィックスを指定します。

@param negative_prefix refute の代わりのプレフィックスを指定します。

@param skip_regexp この正規表現にマッチしたメソッドは定義しません。

@param map メソッド名の変換規則のハッシュを指定します。

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

...nt 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 metho...
...ther
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 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(:"do_#{meth}", *args, &block)
end
ruby2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end
/...

Module#<(other) -> bool | nil (7.0)

比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。

...list[例][ruby]{
module
Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo # => true
p Baz < Bar # => true
p Baz < Foo # => true
p Baz < Qux # => nil
p Baz > Qux # => nil

p Foo < Object.new # => in `<': compared with non class/module (TypeError)
//...