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.

  • :permissions (Array<Permission>, Array<Hash>)

    The values of attribute permissions.

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

    The values of attribute ranges.



9801
9802
9803
9804
9805
9806
9807
# File 'lib/ovirtsdk4/types.rb', line 9801

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

Instance Method Details

#==(other) ⇒ Object

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



9812
9813
9814
9815
9816
9817
9818
# File 'lib/ovirtsdk4/types.rb', line 9812

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

#allow_duplicatesBoolean

Returns the value of the allow_duplicates attribute.

Returns:

  • (Boolean)


9622
9623
9624
# File 'lib/ovirtsdk4/types.rb', line 9622

def allow_duplicates
  @allow_duplicates
end

#allow_duplicates=(value) ⇒ Object

Sets the value of the allow_duplicates attribute.

Parameters:

  • value (Boolean)


9631
9632
9633
# File 'lib/ovirtsdk4/types.rb', line 9631

def allow_duplicates=(value)
  @allow_duplicates = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


9640
9641
9642
# File 'lib/ovirtsdk4/types.rb', line 9640

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


9649
9650
9651
# File 'lib/ovirtsdk4/types.rb', line 9649

def comment=(value)
  @comment = value
end

#default_poolBoolean

Returns the value of the default_pool attribute.

Returns:

  • (Boolean)


9658
9659
9660
# File 'lib/ovirtsdk4/types.rb', line 9658

def default_pool
  @default_pool
end

#default_pool=(value) ⇒ Object

Sets the value of the default_pool attribute.

Parameters:

  • value (Boolean)


9667
9668
9669
# File 'lib/ovirtsdk4/types.rb', line 9667

def default_pool=(value)
  @default_pool = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


9676
9677
9678
# File 'lib/ovirtsdk4/types.rb', line 9676

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


9685
9686
9687
# File 'lib/ovirtsdk4/types.rb', line 9685

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



9823
9824
9825
9826
9827
9828
9829
# File 'lib/ovirtsdk4/types.rb', line 9823

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


9694
9695
9696
# File 'lib/ovirtsdk4/types.rb', line 9694

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


9703
9704
9705
# File 'lib/ovirtsdk4/types.rb', line 9703

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


9712
9713
9714
# File 'lib/ovirtsdk4/types.rb', line 9712

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


9721
9722
9723
# File 'lib/ovirtsdk4/types.rb', line 9721

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



9730
9731
9732
# File 'lib/ovirtsdk4/types.rb', line 9730

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
# File 'lib/ovirtsdk4/types.rb', line 9739

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

#rangesArray<Range>

Returns the value of the ranges attribute.

Returns:



9756
9757
9758
# File 'lib/ovirtsdk4/types.rb', line 9756

def ranges
  @ranges
end

#ranges=(list) ⇒ Object

Sets the value of the ranges attribute.

Parameters:



9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
# File 'lib/ovirtsdk4/types.rb', line 9765

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