HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/gems/ruby-2.6.8/doc/activesupport-6.1.4.1/ri/Module/mattr_reader-i.ri
U:RDoc::AnyMethod[iI"mattr_reader:ETI"Module#mattr_reader;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[	I"PDefines a class attribute and creates a class and instance reader methods. ;TI"LThe underlying class variable is set to +nil+, if it is not previously ;TI"Mdefined. All class and instance methods created will be public, even if ;TI"Gthis method is called with a private or protected access modifier.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim;	[I"module HairColors
;TI"!  mattr_reader :hair_colors
;TI"	end
;TI"
;TI"%HairColors.hair_colors # => nil
;TI"FHairColors.class_variable_set("@@hair_colors", [:brown, :black])
;TI"2HairColors.hair_colors # => [:brown, :black]
;T:@format0o;
;	[I"<The attribute name must be a valid method name in Ruby.;T@o;;	[	I"module Foo
;TI"!  mattr_reader :"1_Badname"
;TI"	end
;TI"7# => NameError: invalid attribute name: 1_Badname
;T;
0o;
;	[I".To omit the instance reader method, pass ;TI"J<tt>instance_reader: false</tt> or <tt>instance_accessor: false</tt>.;T@o;;	[I"module HairColors
;TI"9  mattr_reader :hair_colors, instance_reader: false
;TI"	end
;TI"
;TI"class Person
;TI"  include HairColors
;TI"	end
;TI"
;TI"/Person.new.hair_colors # => NoMethodError
;T;
0o;
;	[I"3You can set a default value for the attribute.;T@o;;	[I"module HairColors
;TI"K  mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red]
;TI"	end
;TI"
;TI"class Person
;TI"  include HairColors
;TI"	end
;TI"
;TI"@Person.new.hair_colors # => [:brown, :black, :blonde, :red];T;
0:
@fileI">lib/active_support/core_ext/module/attribute_accessors.rb;T:0@omit_headings_from_table_of_contents_below00I": default;T[[I"cattr_reader;To;;	[;@A;0I"Y(*syms, instance_reader: true, instance_accessor: true, default: nil, location: nil);T@AFI"Module;TcRDoc::NormalClass00