Class: OvirtSDK4::Cdrom

Inherits:
Device show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (Cdrom) initialize(opts = {})

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

  • :file (File, Hash)

    The value of attribute file.

  • :id (String)

    The value of attribute id.

  • :instance_type (InstanceType, Hash)

    The value of attribute instance_type.

  • :name (String)

    The value of attribute name.

  • :template (Template, Hash)

    The value of attribute template.

  • :vm (Vm, Hash)

    The value of attribute vm.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.



40412
40413
40414
40415
40416
40417
40418
40419
40420
40421
40422
40423
# File 'lib/ovirtsdk4/types.rb', line 40412

def initialize(opts = {})
  super(opts)
  self.comment = opts[:comment]
  self.description = opts[:description]
  self.file = opts[:file]
  self.id = opts[:id]
  self.instance_type = opts[:instance_type]
  self.name = opts[:name]
  self.template = opts[:template]
  self.vm = opts[:vm]
  self.vms = opts[:vms]
end

Instance Method Details

- (String) comment

Returns the value of the comment attribute.

Returns:

  • (String)


40194
40195
40196
# File 'lib/ovirtsdk4/types.rb', line 40194

def comment
  return @comment
end

- (Object) comment=(value)

Sets the value of the comment attribute.

Parameters:

  • value (String)


40203
40204
40205
# File 'lib/ovirtsdk4/types.rb', line 40203

def comment=(value)
  @comment = value
end

- (String) description

Returns the value of the description attribute.

Returns:

  • (String)


40212
40213
40214
# File 'lib/ovirtsdk4/types.rb', line 40212

def description
  return @description
end

- (Object) description=(value)

Sets the value of the description attribute.

Parameters:

  • value (String)


40221
40222
40223
# File 'lib/ovirtsdk4/types.rb', line 40221

def description=(value)
  @description = value
end

- (File) file

Returns the value of the file attribute.

Returns:



40230
40231
40232
# File 'lib/ovirtsdk4/types.rb', line 40230

def file
  return @file
end

- (Object) file=(value)

Sets the value of the file attribute.

The value parameter can be an instance of File 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:

  • value (File, Hash)


40243
40244
40245
40246
40247
40248
# File 'lib/ovirtsdk4/types.rb', line 40243

def file=(value)
  if value.is_a?(Hash)
    value = File.new(value)
  end
  @file = value
end

- (String) id

Returns the value of the id attribute.

Returns:

  • (String)


40255
40256
40257
# File 'lib/ovirtsdk4/types.rb', line 40255

def id
  return @id
end

- (Object) id=(value)

Sets the value of the id attribute.

Parameters:

  • value (String)


40264
40265
40266
# File 'lib/ovirtsdk4/types.rb', line 40264

def id=(value)
  @id = value
end

- (InstanceType) instance_type

Returns the value of the instance_type attribute.

Returns:



40273
40274
40275
# File 'lib/ovirtsdk4/types.rb', line 40273

def instance_type
  return @instance_type
end

- (Object) instance_type=(value)

Sets the value of the instance_type attribute.

The value parameter can be an instance of InstanceType 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:



40286
40287
40288
40289
40290
40291
# File 'lib/ovirtsdk4/types.rb', line 40286

def instance_type=(value)
  if value.is_a?(Hash)
    value = InstanceType.new(value)
  end
  @instance_type = value
end

- (String) name

Returns the value of the name attribute.

Returns:

  • (String)


40298
40299
40300
# File 'lib/ovirtsdk4/types.rb', line 40298

def name
  return @name
end

- (Object) name=(value)

Sets the value of the name attribute.

Parameters:

  • value (String)


40307
40308
40309
# File 'lib/ovirtsdk4/types.rb', line 40307

def name=(value)
  @name = value
end

- (Template) template

Returns the value of the template attribute.

Returns:



40316
40317
40318
# File 'lib/ovirtsdk4/types.rb', line 40316

def template
  return @template
end

- (Object) template=(value)

Sets the value of the template attribute.

The value parameter can be an instance of Template 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:



40329
40330
40331
40332
40333
40334
# File 'lib/ovirtsdk4/types.rb', line 40329

def template=(value)
  if value.is_a?(Hash)
    value = Template.new(value)
  end
  @template = value
end

- (Vm) vm

Returns the value of the vm attribute.

Returns:



40341
40342
40343
# File 'lib/ovirtsdk4/types.rb', line 40341

def vm
  return @vm
end

- (Object) vm=(value)

Sets the value of the vm attribute.

The value parameter can be an instance of Vm 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:

  • value (Vm, Hash)


40354
40355
40356
40357
40358
40359
# File 'lib/ovirtsdk4/types.rb', line 40354

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end

- (Array<Vm>) vms

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


40366
40367
40368
# File 'lib/ovirtsdk4/types.rb', line 40366

def vms
  return @vms
end

- (Object) vms=(list)

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


40374
40375
40376
40377
40378
40379
40380
40381
40382
40383
40384
# File 'lib/ovirtsdk4/types.rb', line 40374

def vms=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Vm.new(value)
      end
    end
  end
  @vms = list
end