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.



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

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.



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

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)


8712
8713
8714
# File 'lib/ovirtsdk4/types.rb', line 8712

def allow_duplicates
  @allow_duplicates
end

#allow_duplicates=(value) ⇒ Object

Sets the value of the allow_duplicates attribute.

Parameters:

  • value (Boolean)


8721
8722
8723
# File 'lib/ovirtsdk4/types.rb', line 8721

def allow_duplicates=(value)
  @allow_duplicates = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


8730
8731
8732
# File 'lib/ovirtsdk4/types.rb', line 8730

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


8739
8740
8741
# File 'lib/ovirtsdk4/types.rb', line 8739

def comment=(value)
  @comment = value
end

#default_poolBoolean

Returns the value of the default_pool attribute.

Returns:

  • (Boolean)


8748
8749
8750
# File 'lib/ovirtsdk4/types.rb', line 8748

def default_pool
  @default_pool
end

#default_pool=(value) ⇒ Object

Sets the value of the default_pool attribute.

Parameters:

  • value (Boolean)


8757
8758
8759
# File 'lib/ovirtsdk4/types.rb', line 8757

def default_pool=(value)
  @default_pool = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


8766
8767
8768
# File 'lib/ovirtsdk4/types.rb', line 8766

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


8775
8776
8777
# File 'lib/ovirtsdk4/types.rb', line 8775

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



8883
8884
8885
8886
8887
8888
# File 'lib/ovirtsdk4/types.rb', line 8883

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


8784
8785
8786
# File 'lib/ovirtsdk4/types.rb', line 8784

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


8793
8794
8795
# File 'lib/ovirtsdk4/types.rb', line 8793

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


8802
8803
8804
# File 'lib/ovirtsdk4/types.rb', line 8802

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


8811
8812
8813
# File 'lib/ovirtsdk4/types.rb', line 8811

def name=(value)
  @name = value
end

#rangesArray<Range>

Returns the value of the ranges attribute.

Returns:



8820
8821
8822
# File 'lib/ovirtsdk4/types.rb', line 8820

def ranges
  @ranges
end

#ranges=(list) ⇒ Object

Sets the value of the ranges attribute.

Parameters:



8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
# File 'lib/ovirtsdk4/types.rb', line 8829

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