Class: OvirtSDK4::File

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

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

  • :content (String)

    The value of attribute content.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :storage_domain (StorageDomain, Hash)

    The value of attribute storage_domain.

  • :type (String)

    The value of attribute type.



37814
37815
37816
37817
37818
37819
# File 'lib/ovirtsdk4/types.rb', line 37814

def initialize(opts = {})
  super(opts)
  self.content = opts[:content]
  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.



37824
37825
37826
37827
37828
37829
# File 'lib/ovirtsdk4/types.rb', line 37824

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


37664
37665
37666
# File 'lib/ovirtsdk4/types.rb', line 37664

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


37673
37674
37675
# File 'lib/ovirtsdk4/types.rb', line 37673

def comment=(value)
  @comment = value
end

#contentString

Returns the value of the content attribute.

Returns:

  • (String)


37682
37683
37684
# File 'lib/ovirtsdk4/types.rb', line 37682

def content
  @content
end

#content=(value) ⇒ Object

Sets the value of the content attribute.

Parameters:

  • value (String)


37691
37692
37693
# File 'lib/ovirtsdk4/types.rb', line 37691

def content=(value)
  @content = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


37700
37701
37702
# File 'lib/ovirtsdk4/types.rb', line 37700

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


37709
37710
37711
# File 'lib/ovirtsdk4/types.rb', line 37709

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



37834
37835
37836
37837
37838
37839
# File 'lib/ovirtsdk4/types.rb', line 37834

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


37718
37719
37720
# File 'lib/ovirtsdk4/types.rb', line 37718

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


37727
37728
37729
# File 'lib/ovirtsdk4/types.rb', line 37727

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


37736
37737
37738
# File 'lib/ovirtsdk4/types.rb', line 37736

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


37745
37746
37747
# File 'lib/ovirtsdk4/types.rb', line 37745

def name=(value)
  @name = value
end

#storage_domainStorageDomain

Returns the value of the storage_domain attribute.

Returns:



37754
37755
37756
# File 'lib/ovirtsdk4/types.rb', line 37754

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.

Parameters:



37767
37768
37769
37770
37771
37772
# File 'lib/ovirtsdk4/types.rb', line 37767

def storage_domain=(value)
  if value.is_a?(Hash)
    value = StorageDomain.new(value)
  end
  @storage_domain = value
end

#typeString

Returns the value of the type attribute.

Returns:

  • (String)


37779
37780
37781
# File 'lib/ovirtsdk4/types.rb', line 37779

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:

  • value (String)


37788
37789
37790
# File 'lib/ovirtsdk4/types.rb', line 37788

def type=(value)
  @type = value
end