Creates a new instance of the {MemoryPolicy} class.
@param opts [Hash] 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.
@option opts [Boolean] :ballooning The value of attribute `ballooning`.
@option opts [Integer] :guaranteed The value of attribute `guaranteed`.
@option opts [Integer] :max The value of attribute `max`.
@option opts [MemoryOverCommit, Hash] :over_commit The value of attribute `over_commit`.
@option opts [TransparentHugePages, Hash] :transparent_huge_pages The value of attribute `transparent_huge_pages`.
# File lib/ovirtsdk4/types.rb, line 8913 def initialize(opts = {}) super(opts) self.ballooning = opts[:ballooning] self.guaranteed = opts[:guaranteed] self.max = opts[:max] self.over_commit = opts[:over_commit] self.transparent_huge_pages = opts[:transparent_huge_pages] end
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 8925 def ==(other) super && @ballooning == other.ballooning && @guaranteed == other.guaranteed && @max == other.max && @over_commit == other.over_commit && @transparent_huge_pages == other.transparent_huge_pages end
Returns the value of the `ballooning` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 8796 def ballooning @ballooning end
Sets the value of the `ballooning` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 8805 def ballooning=(value) @ballooning = value end
Returns the value of the `guaranteed` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 8814 def guaranteed @guaranteed end
Sets the value of the `guaranteed` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 8823 def guaranteed=(value) @guaranteed = value end
Generates a hash value for this object.
# File lib/ovirtsdk4/types.rb, line 8937 def hash super + @ballooning.hash + @guaranteed.hash + @max.hash + @over_commit.hash + @transparent_huge_pages.hash end
Returns the value of the `max` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 8832 def max @max end
Sets the value of the `max` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 8841 def max=(value) @max = value end
Returns the value of the `over_commit` attribute.
@return [MemoryOverCommit]
# File lib/ovirtsdk4/types.rb, line 8850 def over_commit @over_commit end
Sets the value of the `over_commit` attribute.
@param value [MemoryOverCommit, Hash]
The `value` parameter can be an instance of {OvirtSDK4::MemoryOverCommit} 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.
# File lib/ovirtsdk4/types.rb, line 8863 def over_commit=(value) if value.is_a?(Hash) value = MemoryOverCommit.new(value) end @over_commit = value end
Returns the value of the `transparent_huge_pages` attribute.
@return [TransparentHugePages]
# File lib/ovirtsdk4/types.rb, line 8875 def transparent_huge_pages @transparent_huge_pages end
Sets the value of the `transparent_huge_pages` attribute.
@param value [TransparentHugePages, Hash]
The `value` parameter can be an instance of {OvirtSDK4::TransparentHugePages} 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.
# File lib/ovirtsdk4/types.rb, line 8888 def transparent_huge_pages=(value) if value.is_a?(Hash) value = TransparentHugePages.new(value) end @transparent_huge_pages = value end