class NicInfo::Enum

A base class for enumerations

Public Class Methods

add_item( key, value ) click to toggle source
# File lib/nicinfo/enum.rb, line 24
def Enum.add_item( key, value )
  @hash ||= {}
  @hash[ key ] = value
end
const_missing( key ) click to toggle source
# File lib/nicinfo/enum.rb, line 29
def Enum.const_missing( key )
  @hash[ key ]
end
each() { |key, value| ... } click to toggle source
# File lib/nicinfo/enum.rb, line 33
def Enum.each
  @hash.each { |key,value| yield( key, value ) }
end
has_value?(value) click to toggle source
# File lib/nicinfo/enum.rb, line 37
def Enum.has_value? value
  @hash.value?( value )
end
values() click to toggle source
# File lib/nicinfo/enum.rb, line 41
def Enum.values
  @hash.values
end