Class: Libvirt::Collection::AbstractCollection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/libvirt/collection/abstract_collection.rb

Overview

Abstract parent class for all collections within libvirt.

Subclasses of any collection are expected to implement the function all which returns all results of a collection. This will automatically make the enumerability work as well as some methods such as first and length.

Direct Known Subclasses

DomainCollection, InterfaceCollection, NWFilterCollection, NetworkCollection, NodeDeviceCollection, StoragePoolCollection, StorageVolumeCollection

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (AbstractCollection) initialize(interface)

Initializes a new collection. All collections belong to a parent structure in some way, which is expected to be passed in here.

Parameters:

  • (Object) Parent

    object



22
23
24
# File 'lib/libvirt/collection/abstract_collection.rb', line 22

def initialize(interface)
  @interface = interface
end

Instance Attribute Details

- (Object) interface (readonly)

Returns the value of attribute interface



16
17
18
# File 'lib/libvirt/collection/abstract_collection.rb', line 16

def interface
  @interface
end