Class: OsCtl::Lib::Zfs::Snapshot

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

Overview

Class representing a single ZFS snapshot

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dataset, name) ⇒ Snapshot

Returns a new instance of Snapshot.

Parameters:



12
13
14
15
16
# File 'lib/libosctl/zfs/snapshot.rb', line 12

def initialize(dataset, name)
  @dataset = dataset
  @name = name
  @properties = {}
end

Instance Attribute Details

#datasetZfs::Dataset (readonly)

Returns:



5
6
7
# File 'lib/libosctl/zfs/snapshot.rb', line 5

def dataset
  @dataset
end

#propertiesHash (readonly)

Returns:

  • (Hash)


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

def properties
  @properties
end

Instance Method Details

#nameObject



18
19
20
# File 'lib/libosctl/zfs/snapshot.rb', line 18

def name
  to_s
end

#snapshotObject



22
23
24
# File 'lib/libosctl/zfs/snapshot.rb', line 22

def snapshot
  @name
end

#to_sObject



26
27
28
# File 'lib/libosctl/zfs/snapshot.rb', line 26

def to_s
  "#{dataset}@#{snapshot}"
end