482件ヒット
[401-482件を表示]
(0.057秒)
キーワード
- < (12)
- <= (12)
- <=> (12)
- === (12)
- >= (12)
- ancestors (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) -
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (12)
-
deprecate
_ constant (12) -
extend
_ object (12) - extended (12)
- freeze (12)
- include (12)
-
instance
_ method (12) -
instance
_ methods (12) -
module
_ eval (24) -
module
_ exec (12) -
private
_ constant (9) -
private
_ instance _ methods (12) -
protected
_ instance _ methods (12) -
psych
_ yaml _ as (4) - public (48)
-
public
_ constant (9) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
remove
_ class _ variable (12) -
remove
_ const (12) -
yaml
_ as (4)
検索結果
先頭5件
-
Module
# class _ variables(inherit = true) -> [Symbol] (108.0) -
クラス/モジュールに定義されているクラス変数の名前の配列を返します。
...d
class Two < One
@@var2 = 2
end
One.class_variables # => [:@@var1]
Two.class_variables # => [:@@var2, :@@var1]
Two.class_variables(false) # => [:@@var2]
//}
@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#constants... -
Module
# freeze -> self (108.0) -
モジュールを凍結(内容の変更を禁止)します。
...。
凍結したモジュールにメソッドの追加など何らかの変更を加えようとした場合に
FrozenError
が発生します。
@see Object#freeze
//emlist[例][ruby]{
module Foo; end
Foo.freeze
module Foo
def foo; end
end # => FrozenError: can't modify frozen module
//}... -
Module
# instance _ method(name) -> UnboundMethod (108.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
class Interpreter
def do_a() print "there, "; end
def do_d() print "Hello "; end
def do_e() print "!\n"; end
def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_......method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end
interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!
//}... -
Module
# private _ constant(*name) -> self (108.0) -
name で指定した定数の可視性を private に変更します。
...を返します。
@see Module#public_constant, Object#untrusted?
//emlist[例][ruby]{
module Foo
BAR = 'bar'
class Baz; end
QUX = 'qux'
class Quux; end
private_constant :QUX
private_constant :Quux
end
Foo::BAR # => "bar"
Foo::Baz # => Foo::Baz
Foo::QUX # => NameError: private con......stant Foo::QUX referenced
Foo::Quux # => NameError: private constant Foo::Quux referenced
//}... -
Module
# private _ instance _ methods(inherited _ too = true) -> [Symbol] (108.0) -
そのモジュールで定義されている private メソッド名 の一覧を配列で返します。
...。
@see Object#private_methods, Module#instance_methods
//emlist[例][ruby]{
module Foo
def foo; end
private def bar; end
end
module Bar
include Foo
def baz; end
private def qux; end
end
Bar.private_instance_methods # => [:qux, :bar]
Bar.private_instance_methods(false) # => [:qux]
//... -
Module
# protected _ instance _ methods(inherited _ too = true) -> [Symbol] (108.0) -
そのモジュールで定義されている protected メソッド名 の一覧を配列で返します。
...そのモジュールで定義されている protected メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#protected_methods, Module#instance_methods... -
Module
# psych _ yaml _ as(tag) -> () (108.0) -
クラスと tag の間を関連付けます。
...された YAML ドキュメントを Ruby のオブジェクトに
変換したりその逆をしたりすることができます。
この method は deprecated です。 Object.yaml_tag を
かわりに使ってください。
@param tag 対象のクラスに関連付けるタグの文字列... -
Module
# public _ instance _ methods(inherited _ too = true) -> [Symbol] (108.0) -
そのモジュールで定義されている public メソッド名 の一覧を配列で返します。
...そのモジュールで定義されている public メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#public_methods, Module#instance_methods... -
Module
# yaml _ as(tag) -> () (108.0) -
クラスと tag の間を関連付けます。
...された YAML ドキュメントを Ruby のオブジェクトに
変換したりその逆をしたりすることができます。
この method は deprecated です。 Object.yaml_tag を
かわりに使ってください。
@param tag 対象のクラスに関連付けるタグの文字列...