lib/abstractivator/enum.rb in abstractivator-0.0.26 vs lib/abstractivator/enum.rb in abstractivator-0.0.27
- old
+ new
@@ -56,10 +56,10 @@
def define_enum(name, *fields)
if respond_to?(:const_set)
const_set(name, make_enum(*fields))
else # top-level
- Kernel.send(:const_set, name, make_enum(*fields))
+ Object.send(:const_set, name, make_enum(*fields))
end
end
def make_enum(*fields)
if fields.size == 1 && fields.first.is_a?(Hash) && fields.first.keys.all?{|f| f.is_a?(Symbol)}