22件ヒット
[1-22件を表示]
(0.259秒)
検索結果
-
Module
# class _ variable _ set(name , val) -> object (39107.0) -
クラス/モジュールにクラス変数 name を定義して、その値として val をセットします。val を返します。
...をセットします。val を返します。
@param name String または Symbol を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
def foo
@@foo
end
end
def Fred.foo(val)
class_variable_set(:@@foo, val)
end
p Fred.foo(101) # => 101
p Fred.new.foo # => 101
//}... -
ruby 1
. 8 . 3 feature (60.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...5-06-07
: Module#class_variable_get [ruby] [new]
: Module#class_variable_set [ruby] [new]
クラスメソッドから((<変数と定数/クラス変数>))にアクセスするための
((<Module#class_variable_get|Module/class_variable_get>)) と
((<Module#class_variable_set|Module/class_va......def Fred.foo
@@foo = 101 #=> @@foo は Fred クラスのクラス変数ではない。
end
def Fred.foo_foo
class_variable_set(:@@foo, 101) # self が Fred クラス自身であることに注意。クラス変数 @@foo に値をセットする。
end......]
追加。((<ruby-talk:129732>))
=== 2005-02-04
: RSS Parser/Maker [lib] [new]
((<Imageモジュール|URL:http://web.resource.org/rss/1.0/modules/image/>))のサポート
=== 2005-02-03
: RSS::Element#convert(value) [lib] [new]
valueのエンコーディングを変換するメソッ...