Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/muddyit_fu.rb

Instance Method Summary collapse

Instance Method Details

#class_attr_accessor(attribute_name) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/muddyit_fu.rb', line 13

def class_attr_accessor(attribute_name)
  class_eval <<-CODE
    def self.#{attribute_name}
      @@#{attribute_name} ||= nil
    end
    def self.#{attribute_name}=(value)
      @@#{attribute_name} = value
    end
  CODE
end