lib/care.rb
def inspect
      # Simulate the builtin object ID output https://stackoverflow.com/a/11765495/153886
      oid_str = (object_id << 1).to_s(16).rjust(16, '0')

      ivars = instance_variables
      ivars.delete(:@pages)
      ivars_str = ivars.map do |ivar|
        "#{ivar}=#{instance_variable_get(ivar).inspect}"
      end.join(' ')
      synthetic_vars = 'num_hydrated_pages=%d' % @pages.length
      '#<%s:%s %s %s>' % [self.class, oid_str, synthetic_vars, ivars_str]
    end
# We provide an overridden implementation of #inspect to avoid
# printing the actual contents of the cached pages
We provide an overridden implementation of #inspect to avoid
printing the actual contents of the cached pages
We provide an overridden implementation of #inspect to avoid printing the actual contents of the cached pages
def inspect
      oid_str = (object_id << 1).to_s(16).rjust(16, '0')
      ivars = instance_variables
      ivars.delete(:@pages)
      ivars_str = ivars.map do |ivar|
        "#{ivar}=#{instance_variable_get(ivar).inspect}"
      end.join(' ')
      synthetic_vars = 'num_hydrated_pages=%d' % @pages.length
      '#<%s:%s %s %s>' % [self.class, oid_str, synthetic_vars, ivars_str]
    end
def inspect oid_str = ( object_id << 1 ) . to_s ( 16 ) . rjust ( 16 , '0' ) ivars = instance_variables ivars . delete ( :@pages ) ivars_str = ivars . map do | ivar | "#{ivar}=#{instance_variable_get(ivar).inspect}" end . join ( ' ' ) synthetic_vars = 'num_hydrated_pages=%d' % @pages . length '#<%s:%s %s %s>' % [ self . class , oid_str , synthetic_vars , ivars_str ] end
We provide an overridden implementation of #inspect to avoid
printing the actual contents of the cached pages
We provide an overridden implementation of #inspect to avoid printing the actual contents of the cached pages
# Simulate the builtin object ID output https://stackoverflow.com/a/11765495/153886