276件ヒット
[201-276件を表示]
(0.114秒)
ライブラリ
- ビルトイン (216)
- delegate (12)
-
rdoc
/ context (24)
クラス
- Delegator (12)
- Module (132)
- Object (84)
-
RDoc
:: Context (24) -
RDoc
:: Options (24)
キーワード
-
instance
_ methods (12) -
method
_ defined? (12) - methods (12)
-
private
_ method _ defined? (12) -
protected
_ instance _ methods (12) -
protected
_ method _ defined? (12) -
protected
_ methods (24) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ method _ defined? (12) -
public
_ send (24) -
respond
_ to? (12) -
set
_ visibility _ for (12) -
singleton
_ methods (12) - visibility (24)
- visibility= (12)
検索結果
先頭5件
-
RDoc
:: Options # visibility -> :public | :protected | :private (3218.0) -
コマンドライン引数の --visibility で指定したオプションを Symbol で返します。
コマンドライン引数の --visibility で指定したオプションを Symbol
で返します。 -
Object
# respond _ to?(name , include _ all = false) -> bool (3131.0) -
オブジェクトがメソッド name を持つとき真を返します。
...indows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発生する場合は false を返します。
※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライブラリなど、C言語で実装......ドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Symbol または文字列で指定するメソッド名です。
@param include_all private メソッドと protected メソッドを確認の対象に......事になります。
//emlist[][ruby]{
class F
def hello
"Bonjour"
end
end
class D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]
list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour
list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hell... -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (3113.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
...して定義されている特異メソッド名
(public あるいは protected メソッド) の一覧を返します。
inherited_too が真のときは継承した特異メソッドを含みます。
継承した特異メソッドとは Object#extend によって追加された特異メソッド......や、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。
singleton_methods(false) は、Object#methods(false) と同じです。
@param inherited_too 継承した特異メソッドを含める場合は真を......t = Class.new
class <<Parent
private; def private_class_parent() end
protected; def protected_class_parent() end
public; def public_class_parent() end
end
Foo = Class.new(Parent)
class <<Foo
private; def private_class_foo() end
protected; def protected_class_foo() end
public;... -
RDoc
:: Context # set _ visibility _ for(methods , visibility , singleton = false) -> () (3051.0) -
methods で指定した RDoc::AnyMethod、RDoc::Attr の内、 singleton で指定した条件と一致するメソッドすべての可視性を visibility に設定します。
...methods で指定した RDoc::AnyMethod、RDoc::Attr の内、
singleton で指定した条件と一致するメソッドすべての可視性を visibility
に設定します。
@param methods RDoc::AnyMethod、RDoc::Attr オブジェクトの配
列を指定します。
@param vi......sibility 可視性を :public, :protected, :private の内のいずれか
で指定します。
@param singleton 特異メソッドの可視性を変更する場合は true、そうでない
場合は false を指定します。... -
RDoc
:: Options # visibility=(val) (3007.0) -
コマンドライン引数の --visibility オプションと同様の指定を行います。
...コマンドライン引数の --visibility オプションと同様の指定を行います。
@param val :public、:protected、:private のいずれかを指定します。... -
Module
# method _ defined?(name , inherit=true) -> bool (113.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...ublic または protected であるときに
true を返します。
@param name Symbol か String を指定します。
@param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。
@see Module#public_me......_method_defined?, Module#protected_method_defined?
//emlist[例][ruby]{
module A
def method1() end
def protected_method1() end
protected :protected_method1
end
class B
def method2() end
def private_method2() end
private :private_method2
end
class C < B
include A
def method3() e......ue
C.method_defined? "method1" #=> true
C.method_defined? "method2" #=> true
C.method_defined? "method2", true #=> true
C.method_defined? "method2", false #=> false
C.method_defined? "method3" #=> true
C.method_defined? "protected_method1" #=> true
C.... -
Module
# private _ method _ defined?(name , inherit=true) -> bool (55.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が private であるときに true を返します。 そうでなければ false を返します。
...include したモジュールで
定義されたメソッドも対象になります。
@see Module#method_defined?, Module#public_method_defined?, Module#protected_method_defined?
//emlist[例][ruby]{
module A
def method1() end
end
class B
private
def method2() end
end
class C < B......include A
def method3() end
end
A.method_defined? :method1 #=> true
C.private_method_defined? "method1" #=> false
C.private_method_defined? "method2" #=> true
C.private_method_defined? "method2", true #=> true
C.private_method_defined? "method2", false......#=> false
C.method_defined? "method2" #=> false
//}...