1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

fix example format and add markup in Module#mattr_accessor documentation [ci skip]

This commit is contained in:
Francesco Rodriguez 2012-05-29 00:00:32 -05:00
parent 34f82abf01
commit 5487daba97

View file

@ -46,19 +46,19 @@ class Module
# Extends the module object with module and instance accessors for class attributes, # Extends the module object with module and instance accessors for class attributes,
# just like the native attr* accessors for instance attributes. # just like the native attr* accessors for instance attributes.
# #
# module AppConfiguration # module AppConfiguration
# mattr_accessor :google_api_key # mattr_accessor :google_api_key
# #
# self.google_api_key = "123456789" # self.google_api_key = "123456789"
# end # end
# #
# AppConfiguration.google_api_key # => "123456789" # AppConfiguration.google_api_key # => "123456789"
# AppConfiguration.google_api_key = "overriding the api key!" # AppConfiguration.google_api_key = "overriding the api key!"
# AppConfiguration.google_api_key # => "overriding the api key!" # AppConfiguration.google_api_key # => "overriding the api key!"
# #
# To opt out of the instance writer method, pass instance_writer: false. # To opt out of the instance writer method, pass <tt>instance_writer: false</tt>.
# To opt out of the instance reader method, pass instance_reader: false. # To opt out of the instance reader method, pass <tt>instance_reader: false</tt>.
# To opt out of both instance methods, pass instance_accessor: false. # To opt out of both instance methods, pass <tt>instance_accessor: false</tt>.
def mattr_accessor(*syms) def mattr_accessor(*syms)
mattr_reader(*syms) mattr_reader(*syms)
mattr_writer(*syms) mattr_writer(*syms)