るりまサーチ

最速Rubyリファレンスマニュアル検索!
30件ヒット [1-30件を表示] (0.052秒)
トップページ > クエリ:nil[x] > クエリ:end[x] > クエリ:attr_accessor[x]

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zstream stream_end?

ライブラリ

クラス

検索結果

Module#attr_accessor(*name) -> nil (18214.0)

インスタンス変数 name に対する読み取りメソッドと書き込みメソッドの両方を 定義します。

...と書き込みメソッドの両方を
定義します。


このメソッドで定義されるメソッドの定義は以下の通りです。

//emlist[例][ruby]{
def name
@name
end

def name=(val)
@name = val
end

//}

@param name String または Symbol を 1 つ以上指定します。...

クラス/メソッドの定義 (660.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...fined

===[a:class] クラス定義

//emlist[例][ruby]{
class Foo < Super
def test
# ...
end

# ...
end

//}

文法:

class 識別子 [`<' superclass ]
式..
end


文法:

class 識別子 [`<' superclass ]
式..
[rescue [erro...
...返さない場合は nil を返します。

===[a:singleton_class] 特異クラス定義

//emlist[例][ruby]{
obj = Object.new # obj = nil でも可
class << obj
def test
# ...
end

# ...
end

//}

文法:

class `<<' expr
式..
end


文法:

clas...
...てdef foo a, bとも
a + 3 * b
end

//}

メソッド名としては通常の識別子の他に、再定義可能な演算子(例: ==, +, -
など spec/operator を参照)も指定できます(operator参照)。

//emlist[例][ruby]{
class Vector2D
attr_accessor
:x, :y # インスタンス変...

NEWS for Ruby 2.5.0 (78.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展開内部の暗黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を追加...
...12882

* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び出します 14142

* Module
* Module#attr, Module#attr_accessor, Module#attr_reader, Module#attr_writer はパブリックメソッドになりました 14132
* Module#define_method, Module#alias_method...
...7688
* 数値の比較メソッド(<,<=,>=,>)は、coerceメソッドで発生した例外を隠蔽しなくなりました。
coerceがnilを返す場合、変換は不可能です。7688

* Process
* getrusage(2) が存在する場合 Process.#times の精度を改良しまし...

NEWS for Ruby 3.0.0 (72.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...> a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end

//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]...
...ncluded or prepended the receiver. 9573
* Module#public, Module#protected, Module#private, Module#public_class_method, Module#private_class_method, toplevel "private" and "public" methods now accept single array argument with a list of method names. 17314
* Module#attr_accessor, Module#attr_...
...da's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when...