src/ruby/bit_struct/struct_base.rb in BitStructEx-0.0.54 vs src/ruby/bit_struct/struct_base.rb in BitStructEx-0.0.64
- old
+ new
@@ -97,10 +97,10 @@
def method_missing( symbol, *args )
require "bit_struct/#{symbol.id2name}"
class_name = make_class_name symbol
- clazz = const_get class_name.to_sym
+ clazz = eval "BitStruct::#{class_name.to_sym}"
self.class.send :define_method, symbol do |*args|
add_field clazz.new( *args )
end
send symbol, *args