Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/appfront/command/base.rb

Instance Method Summary collapse

Instance Method Details

#cattr_accessor(attribute_name) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/appfront/command/base.rb', line 2

def cattr_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