Class: OsCtl::Lib::Zfs::ObjsetStats::Tree

Inherits:
Object
  • Object
show all
Defined in:
lib/libosctl/zfs/objset_stats/tree.rb

Instance Method Summary collapse

Constructor Details

#initializeTree

Returns a new instance of Tree.



3
4
5
# File 'lib/libosctl/zfs/objset_stats/tree.rb', line 3

def initialize
  @pool_trees = {}
end

Instance Method Details

#<<(pool_tree) ⇒ Object

Parameters:



8
9
10
# File 'lib/libosctl/zfs/objset_stats/tree.rb', line 8

def <<(pool_tree)
  @pool_trees[ pool_tree.pool ] = pool_tree
end

#[](dataset) ⇒ Object

Parameters:

  • dataset (String)


13
14
15
16
# File 'lib/libosctl/zfs/objset_stats/tree.rb', line 13

def [](dataset)
  pool = dataset.split('/').first
  @pool_trees[pool][dataset]
end