aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb58
1 files changed, 29 insertions, 29 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
index e6143a274b..8d0233ce9a 100644
--- a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
+++ b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
@@ -10,14 +10,14 @@ class Class # :nodoc:
def class_inheritable_reader(*syms)
syms.each do |sym|
next if sym.is_a?(Hash)
- class_eval <<-EOS
- def self.#{sym}
- read_inheritable_attribute(:#{sym})
- end
-
- def #{sym}
- self.class.#{sym}
- end
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def self.#{sym} # def self.after_add
+ read_inheritable_attribute(:#{sym}) # read_inheritable_attribute(:after_add)
+ end # end
+
+ def #{sym} # def after_add
+ self.class.#{sym} # self.class.after_add
+ end # end
EOS
end
end
@@ -25,15 +25,15 @@ class Class # :nodoc:
def class_inheritable_writer(*syms)
options = syms.extract_options!
syms.each do |sym|
- class_eval <<-EOS
- def self.#{sym}=(obj)
- write_inheritable_attribute(:#{sym}, obj)
- end
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def self.#{sym}=(obj) # def self.property=(obj)
+ write_inheritable_attribute(:#{sym}, obj) # write_inheritable_attribute(:property, obj)
+ end # end
#{"
- def #{sym}=(obj)
- self.class.#{sym} = obj
- end
+ def #{sym}=(obj) # def property=(obj)
+ self.class.#{sym} = obj # self.class.property = obj
+ end # end
" unless options[:instance_writer] == false }
EOS
end
@@ -42,15 +42,15 @@ class Class # :nodoc:
def class_inheritable_array_writer(*syms)
options = syms.extract_options!
syms.each do |sym|
- class_eval <<-EOS
- def self.#{sym}=(obj)
- write_inheritable_array(:#{sym}, obj)
- end
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def self.#{sym}=(obj) # def self.property=(obj)
+ write_inheritable_array(:#{sym}, obj) # write_inheritable_array(:property, obj)
+ end # end
#{"
- def #{sym}=(obj)
- self.class.#{sym} = obj
- end
+ def #{sym}=(obj) # def property=(obj)
+ self.class.#{sym} = obj # self.class.property = obj
+ end # end
" unless options[:instance_writer] == false }
EOS
end
@@ -59,15 +59,15 @@ class Class # :nodoc:
def class_inheritable_hash_writer(*syms)
options = syms.extract_options!
syms.each do |sym|
- class_eval <<-EOS
- def self.#{sym}=(obj)
- write_inheritable_hash(:#{sym}, obj)
- end
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def self.#{sym}=(obj) # def self.property=(obj)
+ write_inheritable_hash(:#{sym}, obj) # write_inheritable_hash(:property, obj)
+ end # end
#{"
- def #{sym}=(obj)
- self.class.#{sym} = obj
- end
+ def #{sym}=(obj) # def property=(obj)
+ self.class.#{sym} = obj # self.class.property = obj
+ end # end
" unless options[:instance_writer] == false }
EOS
end