From 1946d7b9229fabb52226f9ff82de72872c748d90 Mon Sep 17 00:00:00 2001 From: Alexey Gaziev Date: Thu, 26 Apr 2012 17:20:36 +0400 Subject: AS core_ext refactoring --- activesupport/lib/active_support/core_ext/class/attribute_accessors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/class/attribute_accessors.rb') 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..33775500b4 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb @@ -71,7 +71,7 @@ class Class end EOS end - self.send("#{sym}=", yield) if block_given? + send("#{sym}=", yield) if block_given? end end -- cgit v1.2.3 From 432a65fab2a6c7eb6ff77062e73f7627470f7da7 Mon Sep 17 00:00:00 2001 From: Alexey Gaziev Date: Sun, 29 Apr 2012 01:13:04 +0400 Subject: String quotes and trailing spaces --- .../lib/active_support/core_ext/class/attribute_accessors.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/class/attribute_accessors.rb') 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 33775500b4..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 -- cgit v1.2.3