Class: OvirtSDK4::Image

Inherits:
Identified 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 = {}) ⇒ Image

Creates a new instance of the OvirtSDK4::Image 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):

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :size (Integer)

    The value of attribute size.

  • :storage_domain (StorageDomain, Hash)

    The value of attribute storage_domain.

  • :type (ImageFileType)

    The value of attribute type.



5352
5353
5354
5355
5356
5357
# File 'lib/ovirtsdk4/types.rb', line 5352

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

Instance Method Details

#==(other) ⇒ Object

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



5362
5363
5364
5365
5366
5367
# File 'lib/ovirtsdk4/types.rb', line 5362

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


5202
5203
5204
# File 'lib/ovirtsdk4/types.rb', line 5202

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


5211
5212
5213
# File 'lib/ovirtsdk4/types.rb', line 5211

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


5220
5221
5222
# File 'lib/ovirtsdk4/types.rb', line 5220

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


5229
5230
5231
# File 'lib/ovirtsdk4/types.rb', line 5229

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



5372
5373
5374
5375
5376
5377
# File 'lib/ovirtsdk4/types.rb', line 5372

def hash
  super +
  @size.hash +
  @storage_domain.hash +
  @type.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


5238
5239
5240
# File 'lib/ovirtsdk4/types.rb', line 5238

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


5247
5248
5249
# File 'lib/ovirtsdk4/types.rb', line 5247

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


5256
5257
5258
# File 'lib/ovirtsdk4/types.rb', line 5256

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


5265
5266
5267
# File 'lib/ovirtsdk4/types.rb', line 5265

def name=(value)
  @name = value
end

#sizeInteger

Returns the value of the size attribute.

Returns:

  • (Integer)


5274
5275
5276
# File 'lib/ovirtsdk4/types.rb', line 5274

def size
  @size
end

#size=(value) ⇒ Object

Sets the value of the size attribute.

Parameters:

  • value (Integer)


5283
5284
5285
# File 'lib/ovirtsdk4/types.rb', line 5283

def size=(value)
  @size = value
end

#storage_domainStorageDomain

Returns the value of the storage_domain attribute.

Returns:



5292
5293
5294
# File 'lib/ovirtsdk4/types.rb', line 5292

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 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:



5305
5306
5307
5308
5309
5310
# File 'lib/ovirtsdk4/types.rb', line 5305

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

#typeImageFileType

Returns the value of the type attribute.

Returns:



5317
5318
5319
# File 'lib/ovirtsdk4/types.rb', line 5317

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:



5326
5327
5328
# File 'lib/ovirtsdk4/types.rb', line 5326

def type=(value)
  @type = value
end