Class: OvirtSDK4::StorageDomainLease

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ StorageDomainLease

Creates a new instance of the OvirtSDK4::StorageDomainLease class.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :storage_domain (StorageDomain, Hash)

    The value of attribute storage_domain.


22204
22205
22206
22207
# File 'lib/ovirtsdk4/types.rb', line 22204

def initialize(opts = {})
  super(opts)
  self.storage_domain = opts[:storage_domain]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.


22212
22213
22214
22215
# File 'lib/ovirtsdk4/types.rb', line 22212

def ==(other)
  super &&
  @storage_domain == other.storage_domain
end

#hashObject

Generates a hash value for this object.


22220
22221
22222
22223
# File 'lib/ovirtsdk4/types.rb', line 22220

def hash
  super +
  @storage_domain.hash
end

#storage_domainStorageDomain

Returns the value of the storage_domain attribute.

Returns:


22174
22175
22176
# File 'lib/ovirtsdk4/types.rb', line 22174

def storage_domain
  @storage_domain
end

#storage_domain=(value) ⇒ Object

Sets the value of the storage_domain attribute.

The value parameter can be an instance of OvirtSDK4::StorageDomain or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:


22187
22188
22189
22190
22191
22192
# File 'lib/ovirtsdk4/types.rb', line 22187

def storage_domain=(value)
  if value.is_a?(Hash)
    value = StorageDomain.new(value)
  end
  @storage_domain = value
end