るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.161秒)
トップページ > クエリ:self[x] > クエリ:クラス/メソッドの定義[x]

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document to_s
  4. rexml/document clone
  5. rexml/document node_type

検索結果

クラス/メソッドの定義 (15091.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...
...ークラスを指定するとエラー
class Foo < String
end
# => superclass mismatch for class Foo (TypeError)
//}

クラス定義式の中は self がそのクラスであることと、
limitのデフォルトが異なること以外
にトップレベルとの違いはありません。クラ...
...の外でも良い
def Hoge.bar
end

# 以下のようにすればクラス名が変わってもメソッド部の変更が不要
class Hoge
def self.baz
'To infinity and beyond!'
end
end

# 特異クラス方式。複数のメソッドを一度に定義するとき向き
class << Hoge
def...

1.6.8から1.8.0への変更点(まとめ) (120.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...ました
((<ruby-bugs-ja:313>))。なんだかよくわかりません(^^;

class << Object
p [self.id, self]
class << self
p [self.id, self]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]...
...さあっぱりわかりません(^^;;

class << Object.new
class << self.superclass
p [self.id, self]
end
class << self
p [self.superclass.id, self.superclass]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]...
...(C の do ... while 構文と同じ)をしていませんでした。
((<ruby-list:34618>))

: ((<"rescue/ensure on class/module"|クラス/メソッドの定義/クラス定義>)) [compat]

メソッド定義のほかにもクラス定義やモジュール定義にもrescue/ensureを
つけ...

ruby 1.6 feature (84.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...の戻り値

以下のメソッドの戻り値が正しくなりました。((<ruby-bugs-ja:PR#205>))

* ((<Enumerable/each_with_index>)) が self を返すようになった(以前は nil)
* ((<Process/Process.setpgrp>)) が返す値が不定だった。
* ((<String/ljust>)), ((<String/rju...
...なくても常に dup した文字列を返すようになった

: 2002-03-08 class variable

((<ruby-talk:35122>))

class C
class << self
def test
@@cv = 5
p @@cv
end
end

test
end
=> -:5:in `test': uninitialized class variable @...
...p Marshal.dump(Object.new).unpack("CC").join(".")
=> ruby 1.6.4 (2001-06-11) [i586-linux]
"4.6"

: $SAFE / ((<クラス/メソッドの定義/def>))

doc/NEWS には

Fixed so defining a new method is allowed under $SAFE == 4, which
previously wasn't.

とある...

ruby 1.8.3 feature (18.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...101 #=> @@foo は Fred クラスのクラス変数ではない。
end

def Fred.foo_foo
class_variable_set(:@@foo, 101) # self が Fred クラス自身であることに注意。クラス変数 @@foo に値をセットする。
end

Fred.foo # メソ...
...singleton class [ruby] [change]
特異クラスは複製できなくなりました。((<ruby-talk:142749>))

$ ruby-1.8.3 -e 'class << "str"; self end.dup'
-e:1:in `initialize_copy': can't copy singleton class (TypeError)
from -e:1

=== 2005-05-15
: Pathname#unlink [lib] [comp...
...2005-02-17
: Open3.popen3 [lib] [compat]
Open3.popen3実行後の$?.exitstatusが0になるように修正されました。

: ((<クラス/メソッドの定義/defined?>)) [ruby][bug]
(({defined?(@a = b)}))のような NODE_IASGN が nil ではなく
"assignment" を返すようになり...