# frozen_string_literal: true module LIT # @api private # @since 0.1.0 module Utils def self.camelize(string) string.to_s.split("_").collect(&:capitalize).join end # @api private # @since 0.1.0 class MapHash attr_reader :values def initialize(values) @values = values.transform_keys { |k| k.is_a?(Symbol) ? k.to_s : k } end def [](key) key = key.is_a?(Symbol) ? key.to_s : key @values[key] end def each(&block) @values.each(&block) end def to_h @values end end # @api private # @since 0.1.0 def self.const_reset(mod, const_name, const_value) if mod.const_defined?(const_name, false) mod.send(:remove_const, const_name) end mod.const_set(const_name, const_value) end end end