るりまサーチ

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

別のキーワード

  1. _builtin attr
  2. module attr
  3. net/imap attr
  4. rdoc attr_modifiers
  5. etc sc_thread_attr_stackaddr

検索結果

<< 1 2 3 ... > >>

Module#attr_reader(*name) -> [Symbol] (24226.0)

インスタンス変数 name の読み取りメソッドを定義します。

...タンス変数 name の読み取りメソッドを定義します。

//emlist[例][ruby]{
class User
attr_reader
:name # => [:name]
# 複数の名前を渡すこともできる
attr_reader
:id, :age # => [:id, :age]
end
//}

このメソッドで定義されるメソッドの定義は以下...

Module#attr_reader(*name) -> nil (24202.0)

インスタンス変数 name の読み取りメソッドを定義します。

インスタンス変数 name の読み取りメソッドを定義します。


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

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

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

static VALUE rb_mod_attr_reader(int argc, VALUE *argv, VALUE klass) (12200.0)

rdoc/parser/ruby (60.0)

Ruby のソースコードを解析するためのサブライブラリです。

...についても同様に :attr:、 :attr_reader:、 :attr_writer:、
:attr_accessor: を指定する事ができます。属性の名前は省略できます。

##
# :attr_reader: my_attr_name

=== 隠しメソッド、属性

:method:、 :singleton-method: や :attr: 命令を使う事で実...
...際には定義され
ていないメソッドもドキュメントに含める事ができます。

##
# :attr_writer: ghost_writer
# There is an attribute here, but you can't see it!

##
# :method: ghost_method
# There is a method here, but you can't see it!

##
# this is a commen...

NEWS for Ruby 3.0.0 (36.0)

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

...vel "private" and "public" methods now accept single array argument with a list of method names. 17314
* Module#attr_accessor, Module#attr_reader, Module#attr_writer and Module#attr methods now return an array of defined method names as symbols. 17314
* Module#alias_method now returns the de...
...eywords does not allocate a hash.
* `super` is optimized when the same type of method is called in the previous call if it's not refinements or an attr reader or writer.

=== JIT

* Performance improvements of JIT-ed code
* Microarchitectural optimizations
* Native functions shared b...

絞り込み条件を変える

NEWS for Ruby 2.5.0 (30.0)

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

...* 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, Module#u...

RDoc::Options#extra_accessor_flags -> {String => String} (24.0)

コマンドライン引数の --accessor オプションで指定したアクセサがキー、ア クセサの種類が値のハッシュを返します。

...コマンドライン引数の --accessor オプションで指定したアクセサがキー、ア
クセサの種類が値のハッシュを返します。

値は r、w、rw のいずれかです。それぞれ attr_readerattr_writer、
attr
_accessor に対応します。...

ruby 1.6 feature (18.0)

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

...とがありました。((<ruby-dev:13752>))

: attr_*

アクセサに余計な引数を渡してもエラーになりませんでした。
((<ruby-dev:13748>))

class C
def initialize
@message = 'ok'
end
attr_reader
:message
end
puts C.new.message(1,2,3)...

ruby 1.9 feature (18.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...6

: __send
: __send!

追加

: invoke_method
: invoke_functional_method

削除

=== 2006-07-21

: Module#attr

オプショナル引数の assignable がなくなり、attr_reader 相当になりました
[RCR#331]

=== 2006-06-22

: Module#name

無名モジュールに対しては nil...

BasicObject#! -> bool (12.0)

オブジェクトを真偽値として評価し、その論理否定を返します。

...トが偽であれば真、さもなくば偽

//emlist[例][ruby]{
class NegationRecorder < BasicObject
def initialize
@count = 0
end
attr_reader
:count

def !
@count += 1
super
end
end

recorder = NegationRecorder.new
!recorder
!!!!!!!recorder
puts 'hoge' if !recorder

puts...

絞り込み条件を変える

BasicObject#!=(other) -> bool (12.0)

オブジェクトが other と等しくないことを判定します。

...クト
@see BasicObject#==, BasicObject#!

//emlist[例][ruby]{
class NonequalityRecorder < BasicObject
def initialize
@count = 0
end
attr_reader
:count

def !=(other)
@count += 1
super
end
end
recorder = NonequalityRecorder.new

recorder != 1
puts 'hoge' if recorder != "str"...
<< 1 2 3 ... > >>