るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

rubygems/commands/install_command (26036.0)

Gem パッケージをローカルリポジトリにインストールするためのライブラリです。

...トールしません
-y, --include-dependencies 依存している Gem パッケージをインストールします
--[no-]format-executable Make installed executable names match ruby.
If ruby is ruby18, foo_exec will be...
...た設定ファイルを使用します
--backtrace バックトレースを表示します
--debug Ruby 自体のデバッグオプションを有効にします
Arguments:
GEMNAME インストールする Gem パッケージ...
...名を指定します
Summary:
Gem パッケージをローカルにインストールします
Defaults:
--both --version '>= 0' --rdoc --ri --no-force
--no-test --install-dir /usr/lib/ruby/gems/1.8...

Module#include(*mod) -> self (18185.0)

モジュール mod をインクルードします。

...てしまうような include を行った場合に発生します。

//emlist[例][ruby]{
module M
end
module M2
include
M
end
module M
include
M2
end
//}

実行結果:

-:3:in `append_features': cyclic include detected (ArgumentError)
from -:3:in `include'
from -:3...
...です。
インクルードは多重継承の代わりに用いられており、 mix-in とも呼びます。

//emlist[例][ruby]{
class C
include
FileTest
include
Math
end

p C.ancestors

# => [C, Math, FileTest, Object, Kernel]
//}

モジュールの機能追加は、クラスの継承関...
...ッド探索の順序です)。

同じモジュールを二回以上 include すると二回目以降は無視されます。

//emlist[例][ruby]{
module M
end
class C1
include
M
end
class C2 < C1
include
M # この include は無視される
end

p C2.ancestors # => [C2, C1, M, Object, Ker...

main.include(*modules) -> self (18125.0)

引数 modules で指定したモジュールを後ろから順番に Object にインクルードします。

...odules Module のインスタンス( Enumerable など)を指定します。

@raise ArgumentError 継承関係が循環してしまうような include を行った場
合に発生します。

//emlist[例:][ruby]{
include
Math

hypot(3, 4) # => 5.0
//}

@see Module#include...

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

...ot 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.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby v...
...ility. 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
ruby
2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end
//}...

Proc#ruby2_keywords -> proc (6147.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.

...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.

This should only be used for procs that delegate keywords to another
method, and only for backwards compatibility with Ruby ve...
...atibility. As it does not exist in Ruby versions
before 2.7, check that the proc responds to this method before calling
it. Also, 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, *a...
...rgs, &block) do
send(:"do_#{meth}", *args, &block)
end
foo.ruby2_keywords if foo.respond_to?(:ruby2_keywords)
end
//}...

絞り込み条件を変える

Module#included(class_or_module) -> () (6146.0)

self が Module#include されたときに対象のクラスまたはモジュー ルを引数にしてインタプリタがこのメソッドを呼び出します。

...f が Module#include されたときに対象のクラスまたはモジュー
ルを引数にしてインタプリタがこのメソッドを呼び出します。

@param class_or_module Module#include を実行したオブジェクト

//emlist[例][ruby]{
module Foo
def self.included(mod)
p...
..."#{mod} include #{self}"
end
end
class Bar
include
Foo
end
# => "Bar include Foo"
//}

@see Module#append_features...

Range#include?(obj) -> bool (6131.0)

obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。

...オブジェクトを指定します。

//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true

p (1 .. 3).include?(1.5) # => true
//}

@see d:spec/control#case
@see Range...

Module#include?(mod) -> bool (6125.0)

self かその親クラス / 親モジュールがモジュール mod を インクルードしていれば true を返します。

...クラス / 親モジュールがモジュール mod を
インクルードしていれば true を返します。

@param mod Module を指定します。

//emlist[例][ruby]{
module M
end
class C1
include
M
end
class C2 < C1
end

p C1.include?(M) # => true
p C2.include?(M) # => true
//}...

String#include?(substr) -> bool (6125.0)

文字列中に部分文字列 substr が含まれていれば真を返します。

...文字列中に部分文字列 substr が含まれていれば真を返します。

@param substr 検索する文字列

//emlist[例][ruby]{
"hello".include? "lo" #=> true
"hello".include? "ol" #=> false
"hello".include? ?h #=> true
//}...

Array#include?(val) -> bool (6119.0)

配列が val と == で等しい要素を持つ時に真を返します。

...配列が val と == で等しい要素を持つ時に真を返します。

@param val オブジェクトを指定します。

//emlist[例][ruby]{
a = [ "a", "b", "c" ]
a.include?("b") #=> true
a.include?("z") #=> false
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>