るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.034秒)
トップページ > クエリ:Encoding[x] > クエリ:<<[x] > クエリ:変数と定数[x]

別のキーワード

  1. 変数と定数
  2. 環境変数
  3. 変数と定数 nilclass
  4. 変数と定数 nameerror
  5. 変数と定数 kernel

検索結果

変数と定数 (15045.0)

変数と定数 * local * instance * class * class_var_scope * global * pseudo * const * prio

...変数と定数
* local
* instance
* class
* class_var_scope
* global
* pseudo
* const
* prio

Ruby の変数と定数の種別は変数名の最初の一文字によって、
ローカル変数、
インスタンス変数、
クラス変数、
グローバル変数、
定数
のい...
...ちます。


//emlist[][ruby]{
class Foo
@@a = :a

class << Foo
p @@a #=> :a
end

def Foo.a1
p @@a
end
end

Foo.a1 #=> :a

def Foo.a2
p @@a
end
Foo.a2 #=> NameError になります。

class << Foo
p @@a #=> NameError になります。
end
//}...
...要な場合は
File.expand_path(__FILE__) とする必要があります。

: __LINE__
現在のソースファイル中の行番号

: __ENCODING__
現在のソースファイルのスクリプトエンコーディング

擬似変数の値を変更することはできません。
擬似...

ruby 1.8.3 feature (30.0)

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

...:40832>))

=== 2005-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_s...
...ctx, session_id=nil)
session_id を受け付けるようになりました。((<ruby-core:4663>))

=== 2005-05-19
: REXML::Encoding#decode_sjis [lib] [bug]
: REXML::Encoding#encode_sjis [lib] [bug]
decode_sjis と encode_sjis が
逆に定義されていたバグを修正しました。((<ruby...
...05-05-16
: 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...