X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factivesupport%2Flib%2Factive_support%2Fcore_ext%2Fclass%2Fdelegating_attributes.rb;fp=vendor%2Frails%2Factivesupport%2Flib%2Factive_support%2Fcore_ext%2Fclass%2Fdelegating_attributes.rb;h=0000000000000000000000000000000000000000;hb=36d9f3351a3b4e8159279445190e2287ffdea86c;hp=000ccf4d55ed30ee2440822d6a6ff9c337ae7eea;hpb=913cf6054b1d29b5d2f5e620304af7ee77cc1f1f;p=feedcatcher.git diff --git a/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb b/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb deleted file mode 100644 index 000ccf4..0000000 --- a/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +++ /dev/null @@ -1,47 +0,0 @@ -# These class attributes behave something like the class -# inheritable accessors. But instead of copying the hash over at -# the time the subclass is first defined, the accessors simply -# delegate to their superclass unless they have been given a -# specific value. This stops the strange situation where values -# set after class definition don't get applied to subclasses. -class Class - def superclass_delegating_reader(*names) - class_name_to_stop_searching_on = self.superclass.name.blank? ? "Object" : self.superclass.name - names.each do |name| - class_eval <<-EOS - def self.#{name} # def self.only_reader - if defined?(@#{name}) # if defined?(@only_reader) - @#{name} # @only_reader - elsif superclass < #{class_name_to_stop_searching_on} && # elsif superclass < Object && - superclass.respond_to?(:#{name}) # superclass.respond_to?(:only_reader) - superclass.#{name} # superclass.only_reader - end # end - end # end - def #{name} # def only_reader - self.class.#{name} # self.class.only_reader - end # end - def self.#{name}? # def self.only_reader? - !!#{name} # !!only_reader - end # end - def #{name}? # def only_reader? - !!#{name} # !!only_reader - end # end - EOS - end - end - - def superclass_delegating_writer(*names) - names.each do |name| - class_eval <<-EOS - def self.#{name}=(value) # def self.only_writer=(value) - @#{name} = value # @only_writer = value - end # end - EOS - end - end - - def superclass_delegating_accessor(*names) - superclass_delegating_reader(*names) - superclass_delegating_writer(*names) - end -end