Module: Kernel

Defined in:
lib/value_enums.rb

Instance Method Summary collapse

Instance Method Details

#enum(syms) ⇒ Object


2
3
4
5
6
7
# File 'lib/value_enums.rb', line 2

def enum(syms)
  prefix = self.name.downcase.sub(/::/, ".")
  syms.each do |s|
    const_set(s.to_s.upcase, ":#{prefix}/#{s.to_s.downcase.sub(/_/, "-")}")
  end
end