Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticdot/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/elasticdot/command/base.rb', line 2

def cattr_accessor(attribute_name)
  class_eval "    def self.\#{attribute_name}\n      @@\#{attribute_name} ||= nil\n    end\n    def self.\#{attribute_name}=(value)\n      @@\#{attribute_name} = value\n    end\n  CODE\nend\n"