148件ヒット
[1-100件を表示]
(0.206秒)
ライブラリ
- ビルトイン (40)
-
irb
/ context (12) -
rdoc
/ code _ object (24) -
rdoc
/ context (36) -
rdoc
/ stats (24) - rss (12)
クラス
-
IRB
:: Context (12) - Module (36)
-
RDoc
:: CodeObject (24) -
RDoc
:: Context (36) -
RDoc
:: Stats (24) - Refinement (4)
モジュール
- DublinCoreModel (12)
キーワード
- ancestors (12)
-
append
_ features (12) -
const
_ source _ location (12) -
dc
_ types (12) -
document
_ children= (12) -
each
_ classmodule (12) -
import
_ methods (4) -
initialize
_ classes _ and _ modules (12) -
load
_ modules (12) -
num
_ modules (12) -
num
_ modules= (12) -
remove
_ classes _ and _ modules (12)
検索結果
先頭5件
-
RDoc
:: Context # modules -> [RDoc :: NormalModule] (24202.0) -
追加された RDoc::NormalModule の配列を返します。
...追加された RDoc::NormalModule の配列を返します。... -
RDoc
:: CodeObject # remove _ classes _ and _ modules -> () (15202.0) -
何もしません。RDoc::CodeObject#document_children= に false を指定 した時のコールバックとして呼び出されます。オーバーライドして使用します。
...何もしません。RDoc::CodeObject#document_children= に false を指定
した時のコールバックとして呼び出されます。オーバーライドして使用します。... -
RDoc
:: Context # initialize _ classes _ and _ modules -> () (15202.0) -
追加されたクラスやモジュールをクリアします。
追加されたクラスやモジュールをクリアします。 -
IRB
:: Context # load _ modules -> [String] (12334.0) -
irb の起動時に -r オプション指定で読み込まれたライブラリ、~/.irbrc など の設定ファイル内で IRB.conf[:LOAD_MODULES] 指定で読み込まれたライブラリ の名前の配列を返します。
...irb の起動時に -r オプション指定で読み込まれたライブラリ、~/.irbrc など
の設定ファイル内で IRB.conf[:LOAD_MODULES] 指定で読み込まれたライブラリ
の名前の配列を返します。... -
Refinement
# import _ methods(*modules) -> self (12308.0) -
モジュールからメソッドをインポートします。
...ポートします。
Module#includeと違って、import_methods はメソッドをコピーして
refinement に追加して、refinementでインポートしたメソッドを有効化します。
メソッドをコピーするため、Rubyコードで定義されたメソッドだけしか
イ......t[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end
module M
refine String do
import_methods StrUtils
end
end
using M
p "foo".indent(3) # => " foo"
module M
refine String do
import_methods Enumerable
# Can't import method which is not defined with R......uby code: Enumerable#drop
end
end
//}... -
RDoc
:: Stats # num _ modules -> Integer (12302.0) -
解析したモジュールの数を返します。
解析したモジュールの数を返します。 -
Module
# ancestors -> [Class , Module] (12213.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 (12213.0) -
モジュール(あるいはクラス)に self の機能を追加します。
...体であり、
include を Ruby で書くと以下のように定義できます。
//emlist[例][ruby]{
def include(*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
# const _ source _ location(name , inherited = true) -> [String , Integer] (12207.0) -
name で指定した定数の定義を含むソースコードのファイル名と行番号を配列で返します。
...す。
@param name Symbol,String で定数の名前を指定します。
@param inherited true を指定するとスーパークラスや include したモジュールで定義された定数が対象にはなります。false を指定した場合 対象にはなりません。
@return ソース......st[例][ruby]{
# test.rb:
class A # line 1
C1 = 1
C2 = 2
end
module M # line 6
C3 = 3
end
class B < A # line 10
include M
C4 = 4
end
class A # 継続して A を定義する
C2 = 8 # 定数を再定義する
end
p B.const_source_location('C4') # => ["test.......rb", 12]
p B.const_source_location('C3') # => ["test.rb", 7]
p B.const_source_location('C1') # => ["test.rb", 2]
p B.const_source_location('C3', false) # => nil -- include したモジュールは検索しない
p A.const_source_location('C2') # => ["test.rb", 16...