Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update Module#mattr_accessor documentation [ci skip]

  • Loading branch information...
commit 4f031c8350b08eb0b1eb8abf7eb380654d284abc 1 parent 4df16f3
Francesco Rodríguez frodsan authored
12 activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
View
@@ -48,17 +48,17 @@ def #{sym}=(obj)
#
# module AppConfiguration
# mattr_accessor :google_api_key
- # self.google_api_key = "123456789"
#
- # mattr_accessor :paypal_url
- # self.paypal_url = "www.sandbox.paypal.com"
+ # self.google_api_key = "123456789"
# end
#
+ # AppConfiguration.google_api_key # => "123456789"
# 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 reader method, pass :instance_reader => false.
- # To opt out of both instance methods, pass :instance_accessor => false.
+ # To opt out of the instance writer method, pass instance_writer: false.
+ # To opt out of the instance reader method, pass instance_reader: false.
+ # To opt out of both instance methods, pass instance_accessor: false.
def mattr_accessor(*syms)
mattr_reader(*syms)
mattr_writer(*syms)
Please sign in to comment.
Something went wrong with that request. Please try again.