Module: DiskUsageExtension

Extended by:
T::Sig
Included in:
Pathname
Defined in:
extend/pathname.rb

Instance Method Summary collapse

Instance Method Details

#abvString

Returns:



28
29
30
31
32
33
34
# File 'extend/pathname.rb', line 28

def abv
  out = +""
  compute_disk_usage
  out << "#{number_readable(@file_count)} files, " if @file_count > 1
  out << disk_usage_readable(@disk_usage).to_s
  out.freeze
end

#disk_usageInteger

Returns:

  • (Integer)


12
13
14
15
16
17
# File 'extend/pathname.rb', line 12

def disk_usage
  return @disk_usage if defined?(@disk_usage)

  compute_disk_usage
  @disk_usage
end

#file_countInteger

Returns:

  • (Integer)


20
21
22
23
24
25
# File 'extend/pathname.rb', line 20

def file_count
  return @file_count if defined?(@file_count)

  compute_disk_usage
  @file_count
end