Ruby 2.6.0 リファレンスマニュアル > ライブラリ一覧 > rdoc/contextライブラリ > RDoc::Contextクラス

class RDoc::Context

クラス・モジュールの継承リスト: RDoc::Context < Comparable < RDoc::CodeObject < RDoc::Text < Object < Kernel < BasicObject

要約

モジュール、クラス、メソッドなどの、rdoc/code_objects が定義するクラスを管理するクラスです。

特異メソッド

定義 説明
new -> RDoc::Context

自身を初期化します。

インスタンスメソッド

定義 説明
self <=> other -> -1 | 0 | 1

自身と other の full_name を比較した結果を返します。

add_alias(an_alias) -> RDoc::Alias

引数で指定した RDoc::Alias オブジェクトを追加します。

add_attribute(an_attribute) -> ()

引数で指定した RDoc::Attr オブジェクトを追加します。

add_class(class_type, name, superclass) -> RDoc::SingleClass | RDoc::NormalClass

引数で指定したクラスを追加します。

add_class_or_module(collection, class_type, name, superclass = nil) -> RDoc::NormalClass | RDoc::SingleClass | RDoc::NormalModule

collection に name で指定したクラス、モジュールを追加します。

add_constant(const) -> ()

引数で指定した RDoc::Constant オブジェクトを追加します。

add_include(an_include) -> ()

引数で指定した RDoc::Include オブジェクトを追加します。

add_method(a_method) -> ()

引数で指定した RDoc::AnyMethod オブジェクトを追加します。

add_module(class_type, name) -> RDoc::NormalModule | RDoc::SingleClass | RDoc::NormalClass

引数で指定したモジュールを追加します。

add_require(a_require) -> ()

自身が所属する RDoc::TopLevel オブジェクトに引数で指定した RDoc::Require を追加します。

add_to(array, thing) -> ()

array に thing を追加します。

aliases -> [RDoc::Alias]

追加された RDoc::Alias の配列を返します。

attributes -> [RDoc::Attr]

追加された RDoc::Attr の配列を返します。

classes -> [RDoc::SingleClass | RDoc::NormalClass]

追加されたクラスの配列を返します。

constants -> [RDoc::Constant]

追加された RDoc::Constant の配列を返します。

current_section -> RDoc::Context::Section

現在の section を返します。

defined_in?(file)

Return true if at least part of this thing was defined in file

each_attribute {|a| ... } -> [RDoc::Attr]

追加された RDoc::Attr に対してブロックを評価します。

each_classmodule {|m| ... } -> [RDoc::SingleClass | RDoc::NormalClass | RDoc::NormalModule]

追加されたクラス、モジュールに対してブロックを評価します。

each_constant {|c| ... } -> [RDoc::Constant]

追加された RDoc::Constant に対してブロックを評価します。

each_method {|m| ... } -> [RDoc::AnyMethod]

追加されたメソッド(RDoc::AnyMethod かそのサブクラスのオブジェクト) に対してブロックを評価します。

find_enclosing_module_named(name) -> RDoc::NormalModule | nil

find a module at a higher scope

find_local_symbol(symbol)

Finds a method, constant, attribute, module or files named +symbol+ in this context

find_module_named(name) -> RDoc::NormalModule | nil

追加された RDoc::NormalModule から引数で指定した名前のモジュールを検索します。見つからなかった場合は nil を返します。

find_symbol(symbol, method=nil)

Look up the given symbol. If method is non-nil, then we assume the symbol references a module that contains that method

in_files

Files this context is found in

includes -> [RDoc::Include]

追加された RDoc::Include の配列を返します。

initialize_classes_and_modules -> ()

追加されたクラスやモジュールをクリアします。

initialize_methods_etc -> ()

追加されたメソッド、属性、alias されたメソッド(メソッド名の対応が取れていないものを含む)、require されたファイル、include されたファイル、定数をクリアします。

method_list -> [RDoc::AnyMethod]

追加された(RDoc::AnyMethod かそのサブクラスのオブジェクト)の配列を返します。

modules -> [RDoc::NormalModule]

追加された RDoc::NormalModule の配列を返します。

name -> String

自身の名前を返します。

ongoing_visibility=(vis)

Change the default visibility for new methods

record_location(toplevel)

Record the file that we happen to find it in

requires -> [RDoc::Require]

追加された RDoc::Require の配列を返します。

sections -> RDoc::Context::Section

追加された RDoc::Context::Section の配列を返します。

set_current_section(title, comment) -> ()

Handle sections

set_visibility_for(methods, visibility, singleton = false) -> ()

methods で指定した RDoc::AnyMethodRDoc::Attr の内、 singleton で指定した条件と一致するメソッドすべての可視性を visibility に設定します。

toplevel -> RDoc::TopLevel

自身が所属する RDoc::TopLevel オブジェクトを返します。

unmatched_alias_lists -> {String => RDoc::Alias}

メソッド名の対応が取れていない alias の旧メソッド名がキー、 RDoc::Alias が値の Hash を返します。

unmatched_alias_lists=(val)

メソッド名の対応が取れていない alias の旧メソッド名がキー、 RDoc::Alias が値の Hash を設定します。

visibility -> :public | :protected | :private

自身の可視性を Symbol で返します。

定数

定義 説明
TYPES -> ["class", "instance"]

メソッドの種類を文字列の配列で返します。

VISIBILITIES -> [:public, :protected, :private]

メソッドの可視性を Symbol の配列で返します。

継承したメソッド

! != __id__ __send__ instance_eval instance_exec method_missing singleton_method_added singleton_method_removed singleton_method_undefined < <= == > >= between? clamp !~ === =~ _dump class clone define_singleton_method display enum_for eql? equal? extend freeze frozen? hash initialize initialize_copy inspect instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? itself marshal_dump marshal_load method methods nil? object_id pretty_inspect pretty_print pretty_print_cycle pretty_print_inspect pretty_print_instance_variables private_methods protected_methods psych_to_yaml public_method public_methods public_send remove_instance_variable respond_to? respond_to_missing? send singleton_class singleton_method singleton_methods taint tainted? tap then to_a to_ary to_hash to_int to_io to_proc to_regexp to_s to_str trust untaint untrust untrusted? .yaml_tag ::ARGF ::ARGV ::DATA ::ENV ::FALSE ::NIL ::RUBY_COPYRIGHT ::RUBY_DESCRIPTION ::RUBY_ENGINE ::RUBY_ENGINE_VERSION ::RUBY_PATCHLEVEL ::RUBY_PLATFORM ::RUBY_RELEASE_DATE ::RUBY_REVISION ::RUBY_VERSION ::SCRIPT_LINES__ ::STDERR ::STDIN ::STDOUT ::TOPLEVEL_BINDING ::TRUE comment comment= document_children document_children= document_self document_self= documented? metadata parent parent= parent_file_name parent_name remove_classes_and_modules remove_methods_etc section section= start_doc stop_doc expand_tabs flush_left markup normalize_comment parse strip_hashes strip_newlines strip_stars