diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-09 02:05:20 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-09 02:05:20 -0500 |
commit | dd7e7b3719ab47c50e73f455d7a31f3db18afb42 (patch) | |
tree | 6a4cdc7a5cc32e8773d82d88ce9693f163687ee4 /activesupport/lib | |
parent | 5059c323b042574a07b45f761bacb2964241954b (diff) | |
download | rails-dd7e7b3719ab47c50e73f455d7a31f3db18afb42.tar.gz rails-dd7e7b3719ab47c50e73f455d7a31f3db18afb42.tar.bz2 rails-dd7e7b3719ab47c50e73f455d7a31f3db18afb42.zip |
fix attribute_accessors docs to support 1.8 syntax
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/attribute_accessors.rb | 22 |
1 files changed, 11 insertions, 11 deletions
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 <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 @@ class Class # 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 @@ class Class # 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 |