# Enums are used to build a sets of enumerated values. # # Numeric and bitwise enums are provided, and include provisions for assigned # values and the allowance of gaps. # # enum %w(N1 N2 +2 N3 N4 =7 N5 N6 3 N7) # # gives N1 = 0, N2 = 1, N3 = 4, N4 = 5, N5 = 7, N6 = 8 and N7 = 3 # # enum_bitwise %w(B1 B2 +2 B3 B4 =7 B5 B6 3 B7) # # gives B1 = 1, B2 = 2, B3 = 16, B4 = 32, B5 = 128, B6 = 256 and B7 = 8 module Eymiha class Enum private def self.build(arguments = {}) code = < Object, :method => "self.enum", :enum_type => numeric }) Enum.build({ :object => Object, :method => "self.bitwise_enum", :enum_type => bitwise }) Enum.build({ :object => Module, :method => "enum", :enum_type => numeric }) Enum.build({ :object => Module, :method => "bitwise_enum", :enum_type => bitwise }) end end