Class: FFI::Enum
- Inherits:
-
Object
- Object
- FFI::Enum
- Defined in:
- lib/ffi/enum_generator.rb
Instance Method Summary collapse
-
#set_consts(mod) ⇒ Object
Set constants on the given module for each symbol in this enum.
Instance Method Details
#set_consts(mod) ⇒ Object
Set constants on the given module for each symbol in this enum
This will blow up if a constant of the same name is already defined on mod, so you probably don’t want to do that.
146 147 148 |
# File 'lib/ffi/enum_generator.rb', line 146 def set_consts(mod) symbols.each { |s| mod.const_set(s, self[s]) } end |