Method: Class#class_inheritable_reader

Defined in:
lib/autumn/inheritable_attributes.rb

#class_inheritable_reader(*syms) ⇒ Object

:nodoc:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/autumn/inheritable_attributes.rb', line 32

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
    EOS
  end
end