Class: WeConnect::Enum

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

Class Method Summary collapse

Class Method Details

.enum(array, proc = :to_s) ⇒ Object



12
13
14
15
16
# File 'lib/weconnect/const.rb', line 12

def self.enum(array, proc=:to_s)
  array.each do |c|
    const_set c.underscore.upcase,c.send(proc)
  end
end