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.



9554
9555
9556
9557
9558
9559
9560
# File 'lib/ovirtsdk4/types.rb', line 9554

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.



9565
9566
9567
9568
9569
9570
9571
# File 'lib/ovirtsdk4/types.rb', line 9565

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)


9375
9376
9377
# File 'lib/ovirtsdk4/types.rb', line 9375

def allow_duplicates
  @allow_duplicates
end

#allow_duplicates=(value) ⇒ Object

Sets the value of the allow_duplicates attribute.

Parameters:

  • value (Boolean)


9384
9385
9386
# File 'lib/ovirtsdk4/types.rb', line 9384

def allow_duplicates=(value)
  @allow_duplicates = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


9393
9394
9395
# File 'lib/ovirtsdk4/types.rb', line 9393

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


9402
9403
9404
# File 'lib/ovirtsdk4/types.rb', line 9402

def comment=(value)
  @comment = value
end

#default_poolBoolean

Returns the value of the default_pool attribute.

Returns:

  • (Boolean)


9411
9412
9413
# File 'lib/ovirtsdk4/types.rb', line 9411

def default_pool
  @default_pool
end

#default_pool=(value) ⇒ Object

Sets the value of the default_pool attribute.

Parameters:

  • value (Boolean)


9420
9421
9422
# File 'lib/ovirtsdk4/types.rb', line 9420

def default_pool=(value)
  @default_pool = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


9429
9430
9431
# File 'lib/ovirtsdk4/types.rb', line 9429

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


9438
9439
9440
# File 'lib/ovirtsdk4/types.rb', line 9438

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



9576
9577
9578
9579
9580
9581
9582
# File 'lib/ovirtsdk4/types.rb', line 9576

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


9447
9448
9449
# File 'lib/ovirtsdk4/types.rb', line 9447

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


9456
9457
9458
# File 'lib/ovirtsdk4/types.rb', line 9456

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


9465
9466
9467
# File 'lib/ovirtsdk4/types.rb', line 9465

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


9474
9475
9476
# File 'lib/ovirtsdk4/types.rb', line 9474

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



9483
9484
9485
# File 'lib/ovirtsdk4/types.rb', line 9483

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
# File 'lib/ovirtsdk4/types.rb', line 9492

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:



9509
9510
9511
# File 'lib/ovirtsdk4/types.rb', line 9509

def ranges
  @ranges
end

#ranges=(list) ⇒ Object

Sets the value of the ranges attribute.

Parameters:



9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
# File 'lib/ovirtsdk4/types.rb', line 9518

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