Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6218 from frodsan/fix_docs_32stable

Fix docs to support 1.8 syntax
  • Loading branch information...
commit cb242a9e4808af7a2aab19832846e2947e39e4a0 2 parents 5059c32 + dd7e7b3
@vijaydev vijaydev authored
View
22 activesupport/lib/active_support/core_ext/class/attribute_accessors.rb
@@ -21,11 +21,11 @@ class Class
# end
# # => NameError: invalid attribute name
#
- # If you want to opt out the instance reader method, you can pass <tt>instance_reader: false</tt>
- # or <tt>instance_accessor: false</tt>.
+ # If you want to opt out the instance reader method, you can pass <tt>:instance_reader => false</tt>
+ # or <tt>:instance_accessor => false</tt>.
#
# class Person
- # cattr_reader :hair_colors, instance_reader: false
+ # cattr_reader :hair_colors, :instance_reader => false
# end
#
# Person.new.hair_colors # => NoMethodError
@@ -71,11 +71,11 @@ def #{sym}
# end
# # => NameError: invalid attribute name
#
- # If you want to opt out the instance writer method, pass <tt>instance_writer: false</tt>
- # or <tt>instance_accessor: false</tt>.
+ # If you want to opt out the instance writer method, pass <tt>:instance_writer => false</tt>
+ # or <tt>:instance_accessor => false</tt>.
#
# class Person
- # cattr_writer :hair_colors, instance_writer: false
+ # cattr_writer :hair_colors, :instance_writer => false
# end
#
# Person.new.hair_colors = [:blonde, :red] # => NoMethodError
@@ -133,20 +133,20 @@ def #{sym}=(obj)
# Male.hair_colors << :blue
# Person.hair_colors # => [:brown, :black, :blonde, :red, :blue]
#
- # To opt out of the instance writer method, pass <tt>instance_writer: false</tt>.
- # To opt out of the instance reader method, pass <tt>instance_reader: false</tt>.
+ # To opt out of the instance writer method, pass <tt>:instance_writer => false</tt>.
+ # To opt out of the instance reader method, pass <tt>:instance_reader => false</tt>.
#
# class Person
- # cattr_accessor :hair_colors, instance_writer: false, instance_reader: false
+ # cattr_accessor :hair_colors, :instance_writer => false, :instance_reader => false
# end
#
# Person.new.hair_colors = [:brown] # => NoMethodError
# Person.new.hair_colors # => NoMethodError
#
- # Or pass <tt>instance_accessor: false</tt>, to opt out both instance methods.
+ # Or pass <tt>:instance_accessor => false</tt>, to opt out both instance methods.
#
# class Person
- # cattr_accessor :hair_colors, instance_accessor: false
+ # cattr_accessor :hair_colors, :instance_accessor => false
# end
#
# Person.new.hair_colors = [:brown] # => NoMethodError
Please sign in to comment.
Something went wrong with that request. Please try again.