From dd7e7b3719ab47c50e73f455d7a31f3db18afb42 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Wed, 9 May 2012 02:05:20 -0500 Subject: fix attribute_accessors docs to support 1.8 syntax --- .../core_ext/class/attribute_accessors.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/class') diff --git a/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb b/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb index 6e66841019..5369348c26 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +++ b/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 instance_reader: false - # or instance_accessor: false. + # If you want to opt out the instance reader method, you can pass :instance_reader => false + # or :instance_accessor => false. # # 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 @@ class Class # end # # => NameError: invalid attribute name # - # If you want to opt out the instance writer method, pass instance_writer: false - # or instance_accessor: false. + # If you want to opt out the instance writer method, pass :instance_writer => false + # or :instance_accessor => false. # # 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 @@ class Class # Male.hair_colors << :blue # Person.hair_colors # => [:brown, :black, :blonde, :red, :blue] # - # 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 the instance writer method, pass :instance_writer => false. + # To opt out of the instance reader method, pass :instance_reader => false. # # 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 instance_accessor: false, to opt out both instance methods. + # Or pass :instance_accessor => false, 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 -- cgit v1.2.3