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.


9093
9094
9095
9096
9097
9098
# File 'lib/ovirtsdk4/types.rb', line 9093

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.


9103
9104
9105
9106
9107
9108
# File 'lib/ovirtsdk4/types.rb', line 9103

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)

8942
8943
8944
# File 'lib/ovirtsdk4/types.rb', line 8942

def allow_duplicates
  @allow_duplicates
end

#allow_duplicates=(value) ⇒ Object

Sets the value of the allow_duplicates attribute.

Parameters:

  • value (Boolean)

8951
8952
8953
# File 'lib/ovirtsdk4/types.rb', line 8951

def allow_duplicates=(value)
  @allow_duplicates = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

8960
8961
8962
# File 'lib/ovirtsdk4/types.rb', line 8960

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

8969
8970
8971
# File 'lib/ovirtsdk4/types.rb', line 8969

def comment=(value)
  @comment = value
end

#default_poolBoolean

Returns the value of the default_pool attribute.

Returns:

  • (Boolean)

8978
8979
8980
# File 'lib/ovirtsdk4/types.rb', line 8978

def default_pool
  @default_pool
end

#default_pool=(value) ⇒ Object

Sets the value of the default_pool attribute.

Parameters:

  • value (Boolean)

8987
8988
8989
# File 'lib/ovirtsdk4/types.rb', line 8987

def default_pool=(value)
  @default_pool = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

8996
8997
8998
# File 'lib/ovirtsdk4/types.rb', line 8996

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

9005
9006
9007
# File 'lib/ovirtsdk4/types.rb', line 9005

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


9113
9114
9115
9116
9117
9118
# File 'lib/ovirtsdk4/types.rb', line 9113

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)

9014
9015
9016
# File 'lib/ovirtsdk4/types.rb', line 9014

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

9023
9024
9025
# File 'lib/ovirtsdk4/types.rb', line 9023

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

9032
9033
9034
# File 'lib/ovirtsdk4/types.rb', line 9032

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

9041
9042
9043
# File 'lib/ovirtsdk4/types.rb', line 9041

def name=(value)
  @name = value
end

#rangesArray<Range>

Returns the value of the ranges attribute.

Returns:


9050
9051
9052
# File 'lib/ovirtsdk4/types.rb', line 9050

def ranges
  @ranges
end

#ranges=(list) ⇒ Object

Sets the value of the ranges attribute.

Parameters:


9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
# File 'lib/ovirtsdk4/types.rb', line 9059

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