require "hashy_object/version" class HashyObject class TooMuchRecursionException < Exception; end MAX_RECURSION_LEVELS = 100 attr_accessor :obj attr_accessor :recursion_level def initialize(obj, recursion_level = 0) raise TooMuchRecursionException if recursion_level > MAX_RECURSION_LEVELS self.obj = obj self.recursion_level = recursion_level end def inspect return obj if obj.is_a?(String) return obj.inspect if inspectable? inspectify end def inspectable? return true if obj.is_a?(String) inspected = obj.inspect return false if inspected.match /#