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

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ Cdrom

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

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.



54228
54229
54230
54231
# File 'lib/ovirtsdk4/types.rb', line 54228

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

Instance Method Details

#==(other) ⇒ Object

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



54236
54237
54238
54239
# File 'lib/ovirtsdk4/types.rb', line 54236

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

#commentString

Returns the value of the comment attribute.



54009
54010
54011
# File 'lib/ovirtsdk4/types.rb', line 54009

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



54018
54019
54020
# File 'lib/ovirtsdk4/types.rb', line 54018

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



54027
54028
54029
# File 'lib/ovirtsdk4/types.rb', line 54027

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



54036
54037
54038
# File 'lib/ovirtsdk4/types.rb', line 54036

def description=(value)
  @description = value
end

#fileFile

Returns the value of the file attribute.



54045
54046
54047
# File 'lib/ovirtsdk4/types.rb', line 54045

def file
  @file
end

#file=(value) ⇒ Object

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.



54058
54059
54060
54061
54062
54063
# File 'lib/ovirtsdk4/types.rb', line 54058

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

#hashObject

Generates a hash value for this object.



54244
54245
54246
54247
# File 'lib/ovirtsdk4/types.rb', line 54244

def hash
  super +
  @file.hash
end

#idString

Returns the value of the id attribute.



54070
54071
54072
# File 'lib/ovirtsdk4/types.rb', line 54070

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



54079
54080
54081
# File 'lib/ovirtsdk4/types.rb', line 54079

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.



54088
54089
54090
# File 'lib/ovirtsdk4/types.rb', line 54088

def instance_type
  @instance_type
end

#instance_type=(value) ⇒ Object

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.



54101
54102
54103
54104
54105
54106
# File 'lib/ovirtsdk4/types.rb', line 54101

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

#nameString

Returns the value of the name attribute.



54113
54114
54115
# File 'lib/ovirtsdk4/types.rb', line 54113

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



54122
54123
54124
# File 'lib/ovirtsdk4/types.rb', line 54122

def name=(value)
  @name = value
end

#templateTemplate

Returns the value of the template attribute.



54131
54132
54133
# File 'lib/ovirtsdk4/types.rb', line 54131

def template
  @template
end

#template=(value) ⇒ Object

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.



54144
54145
54146
54147
54148
54149
# File 'lib/ovirtsdk4/types.rb', line 54144

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

#vmVm

Returns the value of the vm attribute.



54156
54157
54158
# File 'lib/ovirtsdk4/types.rb', line 54156

def vm
  @vm
end

#vm=(value) ⇒ Object

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.



54169
54170
54171
54172
54173
54174
# File 'lib/ovirtsdk4/types.rb', line 54169

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

#vmsArray<Vm>

Returns the value of the vms attribute.



54181
54182
54183
# File 'lib/ovirtsdk4/types.rb', line 54181

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.



54190
54191
54192
54193
54194
54195
54196
54197
54198
54199
54200
# File 'lib/ovirtsdk4/types.rb', line 54190

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