lib/store/digest.rb
# Return the stats object as a nicely formatted string.
# @return [String] no joke.
Return the stats object as a nicely formatted string.
Return the stats object as a nicely formatted string .
def to_s
      out = <<-EOT
#{self.class}
  Statistics:
    Created:         #{@ctime}
    Last modified:   #{@mtime}
    Total objects:   #{@objects}
    Deleted records: #{@deleted}
    Repository size: #{human_size}
      EOT
      %i[types languages charsets encodings].each do |k|
        stats = instance_variable_get("@#{k}")
        if stats and !stats.empty?
          out << "  #{LABELS.fetch k, k.capitalize}: #{stats.count}\n"
          stats.keys.sort.each do |s|
            out << "    #{s}: #{stats[s]}\n"
          end
        end
      end
      out
    end
def to_s out = <<-EOT #{ self . class } 
  Statistics:
    Created:          #{ @ctime } 
    Last modified:    #{ @mtime } 
    Total objects:    #{ @objects } 
    Deleted records:  #{ @deleted } 
    Repository size:  #{ human_size } EOT %i[ types languages charsets encodings ] . each do | k | stats = instance_variable_get ( "@#{k}" ) if stats and ! stats . empty? out << "  #{LABELS.fetch k, k.capitalize}: #{stats.count}\n" stats . keys . sort . each do | s | out << "    #{s}: #{stats[s]}\n" end end end out end
Return the stats object as a nicely formatted string.
Return the stats object as a nicely formatted string .
None
String