Class: OvirtSDK4::MacPool

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

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

  • :allow_duplicates (Boolean)

    The value of attribute allow_duplicates.

  • :comment (String)

    The value of attribute comment.

  • :default_pool (Boolean)

    The value of attribute default_pool.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :ranges (Array<Range>, Array<Hash>)

    The values of attribute ranges.



8988
8989
8990
8991
8992
8993
# File 'lib/ovirtsdk4/types.rb', line 8988

def initialize(opts = {})
  super(opts)
  self.allow_duplicates = opts[:allow_duplicates]
  self.default_pool = opts[:default_pool]
  self.ranges = opts[:ranges]
end

Instance Method Details

#==(other) ⇒ Object

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



8998
8999
9000
9001
9002
9003
# File 'lib/ovirtsdk4/types.rb', line 8998

def ==(other)
  super &&
  @allow_duplicates == other.allow_duplicates &&
  @default_pool == other.default_pool &&
  @ranges == other.ranges
end

#allow_duplicatesBoolean

Returns the value of the allow_duplicates attribute.

Returns:

  • (Boolean)


8837
8838
8839
# File 'lib/ovirtsdk4/types.rb', line 8837

def allow_duplicates
  @allow_duplicates
end

#allow_duplicates=(value) ⇒ Object

Sets the value of the allow_duplicates attribute.

Parameters:

  • value (Boolean)


8846
8847
8848
# File 'lib/ovirtsdk4/types.rb', line 8846

def allow_duplicates=(value)
  @allow_duplicates = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


8855
8856
8857
# File 'lib/ovirtsdk4/types.rb', line 8855

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


8864
8865
8866
# File 'lib/ovirtsdk4/types.rb', line 8864

def comment=(value)
  @comment = value
end

#default_poolBoolean

Returns the value of the default_pool attribute.

Returns:

  • (Boolean)


8873
8874
8875
# File 'lib/ovirtsdk4/types.rb', line 8873

def default_pool
  @default_pool
end

#default_pool=(value) ⇒ Object

Sets the value of the default_pool attribute.

Parameters:

  • value (Boolean)


8882
8883
8884
# File 'lib/ovirtsdk4/types.rb', line 8882

def default_pool=(value)
  @default_pool = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


8891
8892
8893
# File 'lib/ovirtsdk4/types.rb', line 8891

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


8900
8901
8902
# File 'lib/ovirtsdk4/types.rb', line 8900

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



9008
9009
9010
9011
9012
9013
# File 'lib/ovirtsdk4/types.rb', line 9008

def hash
  super +
  @allow_duplicates.hash +
  @default_pool.hash +
  @ranges.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


8909
8910
8911
# File 'lib/ovirtsdk4/types.rb', line 8909

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


8918
8919
8920
# File 'lib/ovirtsdk4/types.rb', line 8918

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


8927
8928
8929
# File 'lib/ovirtsdk4/types.rb', line 8927

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


8936
8937
8938
# File 'lib/ovirtsdk4/types.rb', line 8936

def name=(value)
  @name = value
end

#rangesArray<Range>

Returns the value of the ranges attribute.

Returns:



8945
8946
8947
# File 'lib/ovirtsdk4/types.rb', line 8945

def ranges
  @ranges
end

#ranges=(list) ⇒ Object

Sets the value of the ranges attribute.

Parameters:



8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
# File 'lib/ovirtsdk4/types.rb', line 8954

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