diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-04-28 20:18:26 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-04-28 20:18:26 -0700 |
commit | 1a4e27ff96b3b7add1a4a43ca757ea8ee6c05c00 (patch) | |
tree | 03e64efa0e3a307c0f8f58eadc31fc01e26b1cd7 /activesupport/lib/active_support/core_ext/class/attribute_accessors.rb | |
parent | ad2c5ea2786817592014fae09934398173c1a7f9 (diff) | |
parent | 432a65fab2a6c7eb6ff77062e73f7627470f7da7 (diff) | |
download | rails-1a4e27ff96b3b7add1a4a43ca757ea8ee6c05c00.tar.gz rails-1a4e27ff96b3b7add1a4a43ca757ea8ee6c05c00.tar.bz2 rails-1a4e27ff96b3b7add1a4a43ca757ea8ee6c05c00.zip |
Merge pull request #5996 from gazay/remove_excess_selfs
Active Support housekeeping and polish
Diffstat (limited to 'activesupport/lib/active_support/core_ext/class/attribute_accessors.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/attribute_accessors.rb | 6 |
1 files changed, 3 insertions, 3 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 95eb94fdf6..5cb528cfe9 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb @@ -29,7 +29,7 @@ class Class def cattr_reader(*syms) options = syms.extract_options! syms.each do |sym| - raise NameError.new("invalid attribute name") unless sym =~ /^[_A-Za-z]\w*$/ + raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\w*$/ class_eval(<<-EOS, __FILE__, __LINE__ + 1) unless defined? @@#{sym} @@#{sym} = nil @@ -53,7 +53,7 @@ class Class def cattr_writer(*syms) options = syms.extract_options! syms.each do |sym| - raise NameError.new("invalid attribute name") unless sym =~ /^[_A-Za-z]\w*$/ + raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\w*$/ class_eval(<<-EOS, __FILE__, __LINE__ + 1) unless defined? @@#{sym} @@#{sym} = nil @@ -71,7 +71,7 @@ class Class end EOS end - self.send("#{sym}=", yield) if block_given? + send("#{sym}=", yield) if block_given? end end |