種類
- 関数 (44)
- インスタンスメソッド (37)
- 文書 (22)
ライブラリ
- ビルトイン (37)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) - Ruby用語集 (11)
-
private
_ class _ method (15) -
rb
_ singleton _ class (11) -
rb
_ singleton _ class _ attached (11) -
rb
_ singleton _ class _ clone (11) -
rb
_ singleton _ class _ new (11) -
singleton
_ class? (11)
検索結果
先頭5件
-
Object
# singleton _ class -> Class (30457.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...が nil か true か false なら、それぞれ NilClass, TrueClass,
FalseClass を返します。
@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。
//emlist[][ruby]{
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class #......=> #<Class:String>
nil.singleton_class #=> NilClass
//}
@see Object#class... -
Module
# singleton _ class? -> bool (18344.0) -
self が特異クラスの場合に true を返します。そうでなければ false を返し ます。
...self が特異クラスの場合に true を返します。そうでなければ false を返し
ます。
//emlist[例][ruby]{
class C
end
C.singleton_class? # => false
C.singleton_class.singleton_class? # => true
//}... -
VALUE rb
_ singleton _ class(VALUE obj) (18300.0) -
obj に特異クラスを導入し、その特異クラスを返します。 すでに特異クラスが導入されているときはそれをそのまま返します。
obj に特異クラスを導入し、その特異クラスを返します。
すでに特異クラスが導入されているときはそれをそのまま返します。
obj が特異メソッドを定義できない型のオブジェクトである
ときは例外 TypeError を発生します。 -
VALUE rb
_ singleton _ class _ clone(VALUE klass) (18300.0) -
特異クラス klass を clone して返します。 klass が特異クラスでないときはただ klass を返します。
特異クラス klass を clone して返します。
klass が特異クラスでないときはただ klass を返します。 -
VALUE rb
_ singleton _ class _ new(VALUE super) (18300.0) -
super をスーパークラスとする特異クラスを生成し、返します。
super をスーパークラスとする特異クラスを生成し、返します。 -
void rb
_ singleton _ class _ attached(VALUE klass , VALUE obj) (18300.0) -
特異クラス klass にその唯一のインスタンス obj を結びつけます。
特異クラス klass にその唯一のインスタンス obj を結びつけます。 -
Module
# private _ class _ method(*name) -> self (12232.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:foo)......# => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
Module
# private _ class _ method(names) -> self (12232.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:foo)......# => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
Module
# private _ class _ method(*name) -> self (12231.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:foo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_meth......od_defined?(:foo) # => true
//}... -
Ruby用語集 (142.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......ーションソフト組込みに適した特徴を持つ。
https://mruby.org/
: main
トップレベルにおける self。Object クラスのインスタンスである。
===[a:N] N
: nil
NilClass の唯一のインスタンス。また、そのオブジェクトを指す擬似変数......一性
: 特異クラス
: singleton class
すべてのオブジェクトには自身が属すクラスとは別に、オブジェクト固有の
クラスがあり、特異クラスと呼ばれる。
参照:Object#singleton_class
: 特異メソッド
: singleton method
オブジェク... -
NEWS for Ruby 2
. 1 . 0 (72.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.0.0 以降の変更
=== 言語仕様の変更
* キーワード引数のデフォルト値が省略可......tion: false` を受け付けるようになりました
* Kernel
* 追加: Kernel#singleton_method(Object#singleton_method)
* Module
* 追加: Module#using, which activates refinements of the specified module only
in the current class or module definition.
* 追加: Module#si......ngleton_class? レシーバーが特異クラスであれば true を返します。
レシーバーが通常のクラスやモジュールであれば false を返します。
* 拡張: Module#refine はもはや実験的な機能でなくなりました
* 拡張: Module#include と M...