別のキーワード
種類
- インスタンスメソッド (196)
- 文書 (38)
- 特異メソッド (36)
- 関数 (12)
- ライブラリ (12)
ライブラリ
- ビルトイン (112)
-
irb
/ context (12) -
rdoc
/ code _ object (24) -
rdoc
/ context (36) -
rdoc
/ stats (24) -
rdoc
/ top _ level (12) - rss (12)
クラス
-
IRB
:: Context (12) - Module (84)
- Object (12)
-
RDoc
:: CodeObject (24) -
RDoc
:: Context (36) -
RDoc
:: Stats (24) -
RDoc
:: TopLevel (12) - Refinement (4)
モジュール
- DublinCoreModel (12)
オブジェクト
- main (12)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 3
. 0 . 0 (5) -
all
_ classes _ and _ modules (12) - ancestors (12)
-
append
_ features (12) -
const
_ source _ location (12) -
dc
_ types (12) -
document
_ children= (12) -
each
_ classmodule (12) - extend (12)
-
extend
_ object (12) -
import
_ methods (4) - include (12)
-
included
_ modules (12) -
initialize
_ classes _ and _ modules (12) -
load
_ modules (12) -
num
_ modules (12) -
num
_ modules= (12) - prepend (12)
-
rb
_ mod _ included _ modules (12) -
remove
_ classes _ and _ modules (12) - rss (12)
-
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 9 feature (12) -
used
_ modules (12)
検索結果
先頭5件
-
RDoc
:: TopLevel . all _ classes _ and _ modules -> [RDoc :: NormalClass | RDoc :: SingleClass | RDoc :: NormalModule] (6101.0) -
RDoc が収集したクラス、モジュールを配列で返します。
RDoc が収集したクラス、モジュールを配列で返します。 -
VALUE rb
_ mod _ included _ modules(VALUE mod) (6100.0) -
モジュール mod にインクルードされているモジュールの配列を返します。
モジュール mod にインクルードされているモジュールの配列を返します。 -
Module
# prepend(*modules) -> self (125.0) -
指定したモジュールを self の継承チェインの先頭に「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。
...追加されるため、結果として self で定義されたメソッドは
override されます。
modules で指定したモジュールは後ろから順に処理されるため、
modules の先頭が最も優先されます。
また、継承によってこの「上書き」を処理す......メソッドでsuperを呼ぶことで
self のモジュール/クラスのメソッドを呼び出すことができます。
実際の処理は modules の各要素の prepend_features を後ろから順に呼びだすだけです。
Module#prepend_features が継承チェインの改変を実行......理が実現されます。そのため、prepend_features を override することで
prepend の処理を追加/変更できます。
@param modules prepend する Module を指定します
@see Module#prepend_features, Module#prepended
//emlist[例][ruby]{
# super と prepend の組み合わ... -
main
. include(*modules) -> self (123.0) -
引数 modules で指定したモジュールを後ろから順番に Object にインクルードします。
...引数 modules で指定したモジュールを後ろから順番に Object にインクルードします。
@param modules Module のインスタンス( Enumerable など)を指定します。
@raise ArgumentError 継承関係が循環してしまうような include を行った場... -
Object
# extend(*modules) -> self (107.0) -
引数で指定したモジュールのインスタンスメソッドを self の特異 メソッドとして追加します。
...に使用します。
引数に複数のモジュールを指定した場合、最後
の引数から逆順に extend を行います。
@param modules モジュールを任意個指定します(クラスは不可)。
@return self を返します。
//emlist[][ruby]{
module Foo
def a
'o... -
Refinement
# import _ methods(*modules) -> self (101.0) -
モジュールからメソッドをインポートします。
...め、Rubyコードで定義されたメソッドだけしか
インポートできないことに注意してください。
//emlist[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end
module M
refine String do
import_methods StrUtils
end
end
using M
p "foo".in... -
rss (24.0)
-
RSS を扱うためのライブラリです。
...、
* Dublin Core モジュール http://web.resource.org/rss/1.0/modules/dc/
* Syndication モジュール http://web.resource.org/rss/1.0/modules/syndication/
* Content モジュール http://web.resource.org/rss/1.0/modules/content/
* Trackback モジュール http://madskills.com/public/xml....../rss/module/trackback/
* Image モジュール http://web.resource.org/rss/1.0/modules/image/
をサポートしています。
ただし,Content モジュールは content:encoded しかサポートしていません.
=== パース
RSS をパースしたい場合は RSS::Parser クラスを... -
NEWS for Ruby 3
. 0 . 0 (18.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* Module
* Module#include and Module#prepend now affect 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#publ......JIT threads.
== Static analysis
=== RBS
* RBS is a new language for type definition of Ruby programs. It allows writing types of classes and modules with advanced types including union types, overloading, generics, and _interface types_ for duck typing.
* Ruby ships with type definitions for... -
Module
# ancestors -> [Class , Module] (12.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... -
Module
# append _ features(module _ or _ class) -> self (12.0) -
モジュール(あるいはクラス)に self の機能を追加します。
...Module#include の実体であり、
include を Ruby で書くと以下のように定義できます。
//emlist[例][ruby]{
def include(*modules)
modules.reverse_each do |mod|
# append_features や included はプライベートメソッドなので
# 直接 mod.append_features(self)...