Class: OvirtSDK4::Tag

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

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

  • :group (Group, Hash)

    The value of attribute group.

  • :host (Host, Hash)

    The value of attribute host.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :parent (Tag, Hash)

    The value of attribute parent.

  • :template (Template, Hash)

    The value of attribute template.

  • :user (User, Hash)

    The value of attribute user.

  • :vm (Vm, Hash)

    The value of attribute vm.



23568
23569
23570
23571
23572
23573
23574
23575
23576
# File 'lib/ovirtsdk4/types.rb', line 23568

def initialize(opts = {})
  super(opts)
  self.group = opts[:group]
  self.host = opts[:host]
  self.parent = opts[:parent]
  self.template = opts[:template]
  self.user = opts[:user]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

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



23581
23582
23583
23584
23585
23586
23587
23588
23589
# File 'lib/ovirtsdk4/types.rb', line 23581

def ==(other)
  super &&
  @group == other.group &&
  @host == other.host &&
  @parent == other.parent &&
  @template == other.template &&
  @user == other.user &&
  @vm == other.vm
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


23323
23324
23325
# File 'lib/ovirtsdk4/types.rb', line 23323

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


23332
23333
23334
# File 'lib/ovirtsdk4/types.rb', line 23332

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


23341
23342
23343
# File 'lib/ovirtsdk4/types.rb', line 23341

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


23350
23351
23352
# File 'lib/ovirtsdk4/types.rb', line 23350

def description=(value)
  @description = value
end

#groupGroup

Returns the value of the group attribute.

Returns:



23359
23360
23361
# File 'lib/ovirtsdk4/types.rb', line 23359

def group
  @group
end

#group=(value) ⇒ Object

Sets the value of the group attribute.

The value parameter can be an instance of Group or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



23372
23373
23374
23375
23376
23377
# File 'lib/ovirtsdk4/types.rb', line 23372

def group=(value)
  if value.is_a?(Hash)
    value = Group.new(value)
  end
  @group = value
end

#hashObject

Generates a hash value for this object.



23594
23595
23596
23597
23598
23599
23600
23601
23602
# File 'lib/ovirtsdk4/types.rb', line 23594

def hash
  super +
  @group.hash +
  @host.hash +
  @parent.hash +
  @template.hash +
  @user.hash +
  @vm.hash
end

#hostHost

Returns the value of the host attribute.

Returns:



23384
23385
23386
# File 'lib/ovirtsdk4/types.rb', line 23384

def host
  @host
end

#host=(value) ⇒ Object

Sets the value of the host attribute.

The value parameter can be an instance of Host or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Host, Hash)


23397
23398
23399
23400
23401
23402
# File 'lib/ovirtsdk4/types.rb', line 23397

def host=(value)
  if value.is_a?(Hash)
    value = Host.new(value)
  end
  @host = value
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


23409
23410
23411
# File 'lib/ovirtsdk4/types.rb', line 23409

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


23418
23419
23420
# File 'lib/ovirtsdk4/types.rb', line 23418

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


23427
23428
23429
# File 'lib/ovirtsdk4/types.rb', line 23427

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


23436
23437
23438
# File 'lib/ovirtsdk4/types.rb', line 23436

def name=(value)
  @name = value
end

#parentTag

Returns the value of the parent attribute.

Returns:



23445
23446
23447
# File 'lib/ovirtsdk4/types.rb', line 23445

def parent
  @parent
end

#parent=(value) ⇒ Object

Sets the value of the parent attribute.

The value parameter can be an instance of OvirtSDK4::Tag or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Tag, Hash)


23458
23459
23460
23461
23462
23463
# File 'lib/ovirtsdk4/types.rb', line 23458

def parent=(value)
  if value.is_a?(Hash)
    value = Tag.new(value)
  end
  @parent = value
end

#templateTemplate

Returns the value of the template attribute.

Returns:



23470
23471
23472
# File 'lib/ovirtsdk4/types.rb', line 23470

def template
  @template
end

#template=(value) ⇒ Object

Sets the value of the template attribute.

The value parameter can be an instance of OvirtSDK4::Template or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



23483
23484
23485
23486
23487
23488
# File 'lib/ovirtsdk4/types.rb', line 23483

def template=(value)
  if value.is_a?(Hash)
    value = Template.new(value)
  end
  @template = value
end

#userUser

Returns the value of the user attribute.

Returns:



23495
23496
23497
# File 'lib/ovirtsdk4/types.rb', line 23495

def user
  @user
end

#user=(value) ⇒ Object

Sets the value of the user attribute.

The value parameter can be an instance of User or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (User, Hash)


23508
23509
23510
23511
23512
23513
# File 'lib/ovirtsdk4/types.rb', line 23508

def user=(value)
  if value.is_a?(Hash)
    value = User.new(value)
  end
  @user = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



23520
23521
23522
# File 'lib/ovirtsdk4/types.rb', line 23520

def vm
  @vm
end

#vm=(value) ⇒ Object

Sets the value of the vm attribute.

The value parameter can be an instance of Vm or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Vm, Hash)


23533
23534
23535
23536
23537
23538
# File 'lib/ovirtsdk4/types.rb', line 23533

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end