Module: Zunnit::Utils

Included in:
Zunnit
Defined in:
lib/zunnit/utils.rb

Instance Method Summary collapse

Instance Method Details

#mattr_accessor(*attrs) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/zunnit/utils.rb', line 3

def mattr_accessor *attrs 
  attrs.each do |attr|
  module_eval %[
    def self.#{attr.to_s}=(value)
      @#{attr.to_s} = value
    end

    def self.#{attr.to_s}
      @#{attr.to_s}
    end
  ]
  end
end