aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/support/class_attribute_accessors.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/support/class_attribute_accessors.rb')
-rw-r--r--activerecord/lib/active_record/support/class_attribute_accessors.rb43
1 files changed, 0 insertions, 43 deletions
diff --git a/activerecord/lib/active_record/support/class_attribute_accessors.rb b/activerecord/lib/active_record/support/class_attribute_accessors.rb
deleted file mode 100644
index 0e269165a6..0000000000
--- a/activerecord/lib/active_record/support/class_attribute_accessors.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# attr_* style accessors for class-variables that can accessed both on an instance and class level.
-class Class #:nodoc:
- def cattr_reader(*syms)
- syms.each do |sym|
- class_eval <<-EOS
- if ! defined? @@#{sym.id2name}
- @@#{sym.id2name} = nil
- end
-
- def self.#{sym.id2name}
- @@#{sym}
- end
-
- def #{sym.id2name}
- self.class.#{sym.id2name}
- end
- EOS
- end
- end
-
- def cattr_writer(*syms)
- syms.each do |sym|
- class_eval <<-EOS
- if ! defined? @@#{sym.id2name}
- @@#{sym.id2name} = nil
- end
-
- def self.#{sym.id2name}=(obj)
- @@#{sym.id2name} = obj
- end
-
- def #{sym.id2name}=(obj)
- self.class.#{sym.id2name}=(obj)
- end
- EOS
- end
- end
-
- def cattr_accessor(*syms)
- cattr_reader(*syms)
- cattr_writer(*syms)
- end
-end \ No newline at end of file