Class: OvirtSDK4::ReportedDevice

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 = {}) ⇒ ReportedDevice

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

  • :ips (Array<Ip>, Array<Hash>)

    The values of attribute ips.

  • :mac (Mac, Hash)

    The value of attribute mac.

  • :name (String)

    The value of attribute name.

  • :type (ReportedDeviceType)

    The value of attribute type.

  • :vm (Vm, Hash)

    The value of attribute vm.


17768
17769
17770
17771
17772
17773
17774
# File 'lib/ovirtsdk4/types.rb', line 17768

def initialize(opts = {})
  super(opts)
  self.ips = opts[:ips]
  self.mac = opts[:mac]
  self.type = opts[:type]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

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


17779
17780
17781
17782
17783
17784
17785
# File 'lib/ovirtsdk4/types.rb', line 17779

def ==(other)
  super &&
  @ips == other.ips &&
  @mac == other.mac &&
  @type == other.type &&
  @vm == other.vm
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

17583
17584
17585
# File 'lib/ovirtsdk4/types.rb', line 17583

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

17592
17593
17594
# File 'lib/ovirtsdk4/types.rb', line 17592

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

17601
17602
17603
# File 'lib/ovirtsdk4/types.rb', line 17601

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

17610
17611
17612
# File 'lib/ovirtsdk4/types.rb', line 17610

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


17790
17791
17792
17793
17794
17795
17796
# File 'lib/ovirtsdk4/types.rb', line 17790

def hash
  super +
  @ips.hash +
  @mac.hash +
  @type.hash +
  @vm.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

17619
17620
17621
# File 'lib/ovirtsdk4/types.rb', line 17619

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

17628
17629
17630
# File 'lib/ovirtsdk4/types.rb', line 17628

def id=(value)
  @id = value
end

#ipsArray<Ip>

Returns the value of the ips attribute.

Returns:

  • (Array<Ip>)

17637
17638
17639
# File 'lib/ovirtsdk4/types.rb', line 17637

def ips
  @ips
end

#ips=(list) ⇒ Object

Sets the value of the ips attribute.

Parameters:

  • list (Array<Ip>)

17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
# File 'lib/ovirtsdk4/types.rb', line 17646

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

#macMac

Returns the value of the mac attribute.

Returns:


17663
17664
17665
# File 'lib/ovirtsdk4/types.rb', line 17663

def mac
  @mac
end

#mac=(value) ⇒ Object

Sets the value of the mac attribute.

The value parameter can be an instance of Mac 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 (Mac, Hash)

17676
17677
17678
17679
17680
17681
# File 'lib/ovirtsdk4/types.rb', line 17676

def mac=(value)
  if value.is_a?(Hash)
    value = Mac.new(value)
  end
  @mac = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

17688
17689
17690
# File 'lib/ovirtsdk4/types.rb', line 17688

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

17697
17698
17699
# File 'lib/ovirtsdk4/types.rb', line 17697

def name=(value)
  @name = value
end

#typeReportedDeviceType

Returns the value of the type attribute.

Returns:


17706
17707
17708
# File 'lib/ovirtsdk4/types.rb', line 17706

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:


17715
17716
17717
# File 'lib/ovirtsdk4/types.rb', line 17715

def type=(value)
  @type = value
end

#vmVm

Returns the value of the vm attribute.

Returns:


17724
17725
17726
# File 'lib/ovirtsdk4/types.rb', line 17724

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.

Parameters:

  • value (Vm, Hash)

17737
17738
17739
17740
17741
17742
# File 'lib/ovirtsdk4/types.rb', line 17737

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