Class: DuPretty::Prettier::DiskUsage
- Inherits:
-
Object
- Object
- DuPretty::Prettier::DiskUsage
- Defined in:
- lib/du_pretty/prettier.rb
Instance Attribute Summary collapse
-
#kbyte ⇒ Object
Returns the value of attribute kbyte.
-
#path ⇒ Object
Returns the value of attribute path.
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(raw, root, total: nil) ⇒ DiskUsage
constructor
A new instance of DiskUsage.
- #pretty ⇒ Object
- #tree_format ⇒ Object
Constructor Details
#initialize(raw, root, total: nil) ⇒ DiskUsage
Returns a new instance of DiskUsage.
49 50 51 52 53 54 55 |
# File 'lib/du_pretty/prettier.rb', line 49 def initialize(raw, root, total: nil) @raw = raw @root = root @kbyte = raw.split("\t").compact[0].to_i @path = raw.split("\t").compact[1] @total = total end |
Instance Attribute Details
#kbyte ⇒ Object
Returns the value of attribute kbyte.
47 48 49 |
# File 'lib/du_pretty/prettier.rb', line 47 def kbyte @kbyte end |
#path ⇒ Object
Returns the value of attribute path.
47 48 49 |
# File 'lib/du_pretty/prettier.rb', line 47 def path @path end |
#raw ⇒ Object
Returns the value of attribute raw.
47 48 49 |
# File 'lib/du_pretty/prettier.rb', line 47 def raw @raw end |
Instance Method Details
#pretty ⇒ Object
57 58 59 |
# File 'lib/du_pretty/prettier.rb', line 57 def pretty pretty_byte + "\t." + relative_path end |
#tree_format ⇒ Object
61 62 63 |
# File 'lib/du_pretty/prettier.rb', line 61 def tree_format pretty_path + ' ' + pretty_byte end |