るりまサーチ

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

別のキーワード

  1. argf.class lines
  2. argf.class each
  3. argf.class each_line
  4. class new
  5. argf.class readline

検索結果

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

self が 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#ap...

1.6.8から1.8.0への変更点(まとめ) (300.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...よくわかりません(^^;

class
<< Object
p [self.id, self]
class
<< self
p [self.id, self]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]
[537742484, Class]
=> ruby 1.7.3 (2002-09...
...-05) [i586-linux]
[537771634, #<Class:Object>]
[537771634, #<Class:Object>]

さらに、オブジェクトの特異クラスのスーパークラスの特異クラスと
オブジェクトの特異クラスの特異クラスのスーパークラスは同じなのだそう...
...) [change]

追加。変更(仕様の統一)

: ((<Module#include?|Module/include?>)) [new]

Added. ((<ruby-dev:13941>))

: ((<Module#included|Module/included>)) [new]

追加。Module#append_feature の後に呼ばれるhook

: ((<Module#method_removed|Module/method_removed>)) [new]...

Module#ancestors -> [Class, Module] (125.0)

クラス、モジュールのスーパークラスとインクルードしているモジュール を優先順位順に配列に格納して返します。

...順位順に配列に格納して返します。

//emlist[例][ruby]{
module Foo
end
class
Bar
include Foo
end
class
Baz < Bar
p ancestors
p included_modules
p superclass
end
# => [Baz, Bar, Foo, Object, Kernel, BasicObject]
# => [Foo, Kernel]
# => Bar
//}

@see Module#included_modules...
...先順位順に配列に格納して返します。

//emlist[例][ruby]{
module Foo
end
class
Bar
include Foo
end
class
Baz < Bar
p ancestors
p included_modules
p superclass
end
# => [Baz, Bar, Foo, Object, Kernel, BasicObject]
# => [Foo, Kernel]
# => Bar
//}

@see Module#included_modules...

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

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

...ude(*modules)
modules.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...
...de(*modules)
modules.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#prepended(class_or_module) -> () (113.0)

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

...ます。

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

//emlist[例][ruby]{
module A
def self.prepended(mod)
puts "#{self} prepended to #{mod}"
end
end
module Enumerable
prepend A
end
# => "A prepended to Enumerable"
//}

@see Module#included, Module#prepend, M...

絞り込み条件を変える

NEWS for Ruby 3.0.0 (108.0)

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

...d in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a Run...
...timeError is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class
variable from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.

== Command line options

==...
...ct classes and modules that have already included or prepended the receiver, mirroring the behavior if the arguments were included in the receiver before the other modules and classes included or prepended the receiver. 9573
* Module#public, Module#protected, Module#private, Module#public_class_...

NEWS for Ruby 2.0.0 (36.0)

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

...' で始まる使用されていない変数は警告しなくなりました

=== 組み込みクラスの更新

* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
IO にある同名のメソッドに対応します

* Array
* 追加: Array#bsearch 二分探...
...定数、メソッド、モジュール変数を「上書き」します。
* 追加: Module.prepended, Module.prepend_features は Module.included と Module.append_features に似ています
* 追加(実験的): Module#refine, スコープを限定してクラスやモジュールを拡...
...した。そのようなときは ThreadError が発生します
* Mutex#sleep may spurious wakeup. Check after wakeup.

* NilClass
* 追加: NilClass#to_h 空のハッシュを返します

* ObjectSpace::WeakMap
* 弱い参照を保持するための低レベルのクラスです...

Object#extend(*modules) -> self (18.0)

引数で指定したモジュールのインスタンスメソッドを self の特異 メソッドとして追加します。

...a
'ok Foo'
end
end

module Bar
def b
'ok Bar'
end
end

obj = Object.new
obj.extend Foo, Bar
p obj.a #=> "ok Foo"
p obj.b #=> "ok Bar"

class
Klass
include Foo
extend Bar
end

p Klass.new.a #=> "ok Foo"
p Klass.b #=> "ok Bar"
//}

extend の機能は、「特異クラスに対...
...ただしその場合、フック用のメソッド
が Module#extended ではなく Module#included になるという違いがあります。

//emlist[][ruby]{
# obj.extend Foo, Bar とほぼ同じ
class
<< obj
include Foo, Bar
end
//}

@see Module#extend_object,Module#include,Module#extended...

rdoc/generator/json_index (12.0)

他のジェネレータが生成する HTML で検索が行えるように、JSON の検索インデッ クスを生成するサブライブラリです。

...contains verbatim code written by him.

このジェネレータは HTML ジェネレータと一緒に使うために設計されています。:

class
RDoc::Generator::Darkfish
def initialize options
# ...
@base_dir = Pathname.pwd.expand_path

@json_index = RDoc::Generator...
...whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED,...