Class: OvirtSDK4::SchedulingPolicyUnit

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

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

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :enabled (Boolean)

    The value of attribute enabled.

  • :id (String)

    The value of attribute id.

  • :internal (Boolean)

    The value of attribute internal.

  • :name (String)

    The value of attribute name.

  • :properties (Array<Property>, Array<Hash>)

    The values of attribute properties.

  • :type (PolicyUnitType)

    The value of attribute type.


18558
18559
18560
18561
18562
18563
18564
# File 'lib/ovirtsdk4/types.rb', line 18558

def initialize(opts = {})
  super(opts)
  self.enabled = opts[:enabled]
  self.internal = opts[:internal]
  self.properties = opts[:properties]
  self.type = opts[:type]
end

Instance Method Details

#==(other) ⇒ Object

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


18569
18570
18571
18572
18573
18574
18575
# File 'lib/ovirtsdk4/types.rb', line 18569

def ==(other)
  super &&
  @enabled == other.enabled &&
  @internal == other.internal &&
  @properties == other.properties &&
  @type == other.type
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

18387
18388
18389
# File 'lib/ovirtsdk4/types.rb', line 18387

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

18396
18397
18398
# File 'lib/ovirtsdk4/types.rb', line 18396

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

18405
18406
18407
# File 'lib/ovirtsdk4/types.rb', line 18405

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

18414
18415
18416
# File 'lib/ovirtsdk4/types.rb', line 18414

def description=(value)
  @description = value
end

#enabledBoolean

Returns the value of the enabled attribute.

Returns:

  • (Boolean)

18423
18424
18425
# File 'lib/ovirtsdk4/types.rb', line 18423

def enabled
  @enabled
end

#enabled=(value) ⇒ Object

Sets the value of the enabled attribute.

Parameters:

  • value (Boolean)

18432
18433
18434
# File 'lib/ovirtsdk4/types.rb', line 18432

def enabled=(value)
  @enabled = value
end

#hashObject

Generates a hash value for this object.


18580
18581
18582
18583
18584
18585
18586
# File 'lib/ovirtsdk4/types.rb', line 18580

def hash
  super +
  @enabled.hash +
  @internal.hash +
  @properties.hash +
  @type.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

18441
18442
18443
# File 'lib/ovirtsdk4/types.rb', line 18441

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

18450
18451
18452
# File 'lib/ovirtsdk4/types.rb', line 18450

def id=(value)
  @id = value
end

#internalBoolean

Returns the value of the internal attribute.

Returns:

  • (Boolean)

18459
18460
18461
# File 'lib/ovirtsdk4/types.rb', line 18459

def internal
  @internal
end

#internal=(value) ⇒ Object

Sets the value of the internal attribute.

Parameters:

  • value (Boolean)

18468
18469
18470
# File 'lib/ovirtsdk4/types.rb', line 18468

def internal=(value)
  @internal = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

18477
18478
18479
# File 'lib/ovirtsdk4/types.rb', line 18477

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

18486
18487
18488
# File 'lib/ovirtsdk4/types.rb', line 18486

def name=(value)
  @name = value
end

#propertiesArray<Property>

Returns the value of the properties attribute.

Returns:


18495
18496
18497
# File 'lib/ovirtsdk4/types.rb', line 18495

def properties
  @properties
end

#properties=(list) ⇒ Object

Sets the value of the properties attribute.

Parameters:


18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
# File 'lib/ovirtsdk4/types.rb', line 18504

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

#typePolicyUnitType

Returns the value of the type attribute.

Returns:


18521
18522
18523
# File 'lib/ovirtsdk4/types.rb', line 18521

def type
  @type
end

#type=(value) ⇒ Object

Sets the value of the type attribute.

Parameters:


18530
18531
18532
# File 'lib/ovirtsdk4/types.rb', line 18530

def type=(value)
  @type = value
end