class OvirtSDK4::MemoryPolicy
Public Class Methods
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`.
OvirtSDK4::Struct::new
# File lib/ovirtsdk4/types.rb, line 9763 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
Public Instance Methods
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 9775 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 9646 def ballooning @ballooning end
Sets the value of the `ballooning` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 9655 def ballooning=(value) @ballooning = value end
Returns the value of the `guaranteed` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 9664 def guaranteed @guaranteed end
Sets the value of the `guaranteed` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 9673 def guaranteed=(value) @guaranteed = value end
Generates a hash value for this object.
OvirtSDK4::Struct#hash
# File lib/ovirtsdk4/types.rb, line 9787 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 9682 def max @max end
Sets the value of the `max` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 9691 def max=(value) @max = value end
Returns the value of the `over_commit` attribute.
@return [MemoryOverCommit]
# File lib/ovirtsdk4/types.rb, line 9700 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 9713 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 9725 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 9738 def transparent_huge_pages=(value) if value.is_a?(Hash) value = TransparentHugePages.new(value) end @transparent_huge_pages = value end