lib/amazon_product_advertising_api/support.rb
# Pleasant syntax for Class attribute readers.
Pleasant syntax for Class attribute readers.
Pleasant syntax for Class attribute readers .
def cattr_reader(sym)
        class_eval(<<-EOS, __FILE__, __LINE__)
          unless defined? @@#{sym}  # unless defined? @@hair_colors
            @@#{sym} = nil          #   @@hair_colors = nil
          end                       # end
                                    #
          def self.#{sym}           # def self.hair_colors
            @@#{sym}                #   @@hair_colors
          end                       # end
                                    #
          def #{sym}                # def hair_colors
            @@#{sym}                #   @@hair_colors
          end                       # end
        EOS
      end
def cattr_reader ( sym ) class_eval ( <<-EOS , __FILE__ , __LINE__ ) 
          unless defined? @@ #{ sym }   # unless defined? @@hair_colors
            @@ #{ sym }  = nil          #   @@hair_colors = nil
          end                       # end
                                    #
          def self. #{ sym }            # def self.hair_colors
            @@ #{ sym }                 #   @@hair_colors
          end                       # end
                                    #
          def  #{ sym }                 # def hair_colors
            @@ #{ sym }                 #   @@hair_colors
          end                       # end
         EOS end
Pleasant syntax for Class attribute readers.
Pleasant syntax for Class attribute readers .
sym
<not_specific>