22件ヒット
[1-22件を表示]
(0.154秒)
別のキーワード
検索結果
-
クラス/メソッドの定義 (15049.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......と異なるスーパークラスを指定すると TypeError が発生します。
//emlist[][ruby]{
class Foo < Array
def foo
end
end
# 定義を追加(スーパークラス Array を明示的に指定しても同じ)
class Foo
def bar
end
end
# 間違ったスーパークラスを指......# -obj
# 要素代入
def foo=(value); end # obj.foo = value
# [] と []=
def [](key); end # obj[key]
def []=(key, value); end # obj[key] = value
def []=(key, key2, value); end # obj[key, key2] = value
# バッククォート記法
def `(arg); en... -
ruby 1
. 6 feature (108.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...しません
でした。
File.symlink("foo", "bar")
p Dir.glob("bar")
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[]
=> ruby 1.6.7 (2002-08-01) [i586-linux]
["bar"]
: 2002-06-13 Hash[]
Hash[] で、キーとなる文字列を dup & freeze し......11:in `[]=': wrong # of arguments(1 for 0) (ArgumentError)
from -:11:in `foo'
from -:14
ruby 1.6.5 (2001-10-05) [i586-linux]
: Subclass of String and Array
String, Array のサブクラスで特定のメソッドを呼ぶと、String, Array
に......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.
とある...