Class: OvirtSDK4::Floppy

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

- (Floppy) initialize(opts = {})

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



30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
# File 'lib/ovirtsdk4/types.rb', line 30025

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)


29807
29808
29809
# File 'lib/ovirtsdk4/types.rb', line 29807

def comment
  return @comment
end

- (Object) comment=(value)

Sets the value of the comment attribute.

Parameters:

  • value (String)


29816
29817
29818
# File 'lib/ovirtsdk4/types.rb', line 29816

def comment=(value)
  @comment = value
end

- (String) description

Returns the value of the description attribute.

Returns:

  • (String)


29825
29826
29827
# File 'lib/ovirtsdk4/types.rb', line 29825

def description
  return @description
end

- (Object) description=(value)

Sets the value of the description attribute.

Parameters:

  • value (String)


29834
29835
29836
# File 'lib/ovirtsdk4/types.rb', line 29834

def description=(value)
  @description = value
end

- (File) file

Returns the value of the file attribute.

Returns:



29843
29844
29845
# File 'lib/ovirtsdk4/types.rb', line 29843

def file
  return @file
end

- (Object) file=(value)

Sets the value of the file attribute.

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


29856
29857
29858
29859
29860
29861
# File 'lib/ovirtsdk4/types.rb', line 29856

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)


29868
29869
29870
# File 'lib/ovirtsdk4/types.rb', line 29868

def id
  return @id
end

- (Object) id=(value)

Sets the value of the id attribute.

Parameters:

  • value (String)


29877
29878
29879
# File 'lib/ovirtsdk4/types.rb', line 29877

def id=(value)
  @id = value
end

- (InstanceType) instance_type

Returns the value of the instance_type attribute.

Returns:



29886
29887
29888
# File 'lib/ovirtsdk4/types.rb', line 29886

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:



29899
29900
29901
29902
29903
29904
# File 'lib/ovirtsdk4/types.rb', line 29899

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)


29911
29912
29913
# File 'lib/ovirtsdk4/types.rb', line 29911

def name
  return @name
end

- (Object) name=(value)

Sets the value of the name attribute.

Parameters:

  • value (String)


29920
29921
29922
# File 'lib/ovirtsdk4/types.rb', line 29920

def name=(value)
  @name = value
end

- (Template) template

Returns the value of the template attribute.

Returns:



29929
29930
29931
# File 'lib/ovirtsdk4/types.rb', line 29929

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:



29942
29943
29944
29945
29946
29947
# File 'lib/ovirtsdk4/types.rb', line 29942

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:



29954
29955
29956
# File 'lib/ovirtsdk4/types.rb', line 29954

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)


29967
29968
29969
29970
29971
29972
# File 'lib/ovirtsdk4/types.rb', line 29967

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


29979
29980
29981
# File 'lib/ovirtsdk4/types.rb', line 29979

def vms
  return @vms
end

- (Object) vms=(list)

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
# File 'lib/ovirtsdk4/types.rb', line 29987

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