別のキーワード
種類
- 文書 (44)
- インスタンスメソッド (11)
ライブラリ
- ビルトイン (11)
クラス
- Object (11)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- クラス/メソッドの定義 (11)
検索結果
先頭5件
-
Object
# singleton _ class -> Class (27137.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...します。
@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... -
Ruby用語集 (96.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...称は interactive Ruby から。
参照:irb
: is-a 関係
Ruby では Object#is_a? で確認できる関係。
たとえば、配列オブジェクトは Array クラスや Enumerable モジュール、Object クラス
などに対して is_a? の関係にある。
: ISO/IEC 30170
J......アプリケーションソフト組込みに適した特徴を持つ。
https://mruby.org/
: main
トップレベルにおける self。Object クラスのインスタンスである。
===[a:N] N
: nil
NilClass の唯一のインスタンス。また、そのオブジェクトを指......は自身が属すクラスとは別に、オブジェクト固有の
クラスがあり、特異クラスと呼ばれる。
参照:Object#singleton_class
: 特異メソッド
: singleton method
オブジェクト固有のメソッド。
オブジェクトの特異クラスのインス... -
NEWS for Ruby 2
. 1 . 0 (78.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* 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#singleton_class? レシーバーが特異クラスであれ......vate"
def foo
end
end
//}
* Object#untrusted?,Object#untrust,Object#trust
* これらのメソッドは非推奨になりました。$VERBOSE が true のときは警告を表示します。
Object#tainted?,Object#taint,Object#untaint とそれぞれ同じ動作です。......身を含みます。
The ancestors of a singleton class now include singleton classes,
in particular itself.
* Module#define_method Object#define_singleton_method
* 定義したメソッドの名前をシンボルで返すようになりました。メソッドオブジェクト... -
クラス/メソッドの定義 (64.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...クラス/メソッドの定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* d......の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。
===[a:singleton_class] 特異クラス定義
//emlist[例][ruby]{
obj = Object.new # obj = nil でも可
class << obj
def test
# ...
end
# ...
end
//}
文法:
class `<<'......義したメソッドや定数は指定した
オブジェクトに対してだけ有効になります。
Object#clone で生成したオブジェクトには引き継がれますが,
Object#dup で生成したオブジェクトには引き継がれません.
rescue/ensure 節を指定し、... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (24.0)
-
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or plus minus ast slash hat sq period comma langl rangl eq tilde dollar at under lbrarbra lbra2rbra2 lbra3rbra3 dq colon ac backslash semicolon
...。d:spec/variables#const を参照。
: ::DateTime
定数のスコープ演算子で、トップレベルの定数であることを示す。Object クラスで
定義されている定数(トップレベルの定数と言う)を確実に参照するためには
d:spec/variables#const を参......クラス定義でスーパークラスを指定しています。
d:spec/def#class。
: class << obj
特異クラス定義。d:spec/def#singleton_classを参照。
===[a:rangl] >
: 3 > 5
「より大きい」比較演算子
: 3 >= 5
「より大きいか等しい」比較演算子
: 3......号演算子。または類似のメソッド。
: a === 12
特殊な等号演算子。Object#===での説明:「このメソッドは case 文での比較に用いられます。
デフォルトは Object#== と同じ働きをしますが、 この挙動はサブクラスで所属性のチェ...