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.

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.



5998
5999
6000
6001
6002
6003
# File 'lib/ovirtsdk4/types.rb', line 5998

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.



6008
6009
6010
6011
6012
6013
# File 'lib/ovirtsdk4/types.rb', line 6008

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

#commentString

Returns the value of the comment attribute.



5848
5849
5850
# File 'lib/ovirtsdk4/types.rb', line 5848

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



5857
5858
5859
# File 'lib/ovirtsdk4/types.rb', line 5857

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



5866
5867
5868
# File 'lib/ovirtsdk4/types.rb', line 5866

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



5875
5876
5877
# File 'lib/ovirtsdk4/types.rb', line 5875

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



6018
6019
6020
6021
6022
6023
# File 'lib/ovirtsdk4/types.rb', line 6018

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

#idString

Returns the value of the id attribute.



5884
5885
5886
# File 'lib/ovirtsdk4/types.rb', line 5884

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



5893
5894
5895
# File 'lib/ovirtsdk4/types.rb', line 5893

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.



5902
5903
5904
# File 'lib/ovirtsdk4/types.rb', line 5902

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



5911
5912
5913
# File 'lib/ovirtsdk4/types.rb', line 5911

def name=(value)
  @name = value
end

#sizeInteger

Returns the value of the size attribute.



5920
5921
5922
# File 'lib/ovirtsdk4/types.rb', line 5920

def size
  @size
end

#size=(value) ⇒ Object

Sets the value of the size attribute.



5929
5930
5931
# File 'lib/ovirtsdk4/types.rb', line 5929

def size=(value)
  @size = value
end

#storage_domainStorageDomain

Returns the value of the storage_domain attribute.



5938
5939
5940
# File 'lib/ovirtsdk4/types.rb', line 5938

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.



5951
5952
5953
5954
5955
5956
# File 'lib/ovirtsdk4/types.rb', line 5951

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.



5963
5964
5965
# File 'lib/ovirtsdk4/types.rb', line 5963

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.



5972
5973
5974
# File 'lib/ovirtsdk4/types.rb', line 5972

def type=(value)
  @type = value
end