spinoff from ActiveSupport class attribute
# File lib/tarantool/core-ext.rb, line 6 def t_class_attribute(*attrs) attrs.each do |name| class_eval def self.#{name}() nil end def self.#{name}?() !!#{name} end def self.#{name}=(val) singleton_class.class_eval do begin if method_defined?(:"#{name}") || private_method_defined?(:"#{name}") remove_method(:#{name}) end rescue NameError end define_method(:#{name}) { val } end val end, __FILE__, __LINE__ + 1 end end
Generated with the Darkfish Rdoc Generator 2.