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.



22344
22345
22346
22347
22348
22349
22350
22351
22352
# File 'lib/ovirtsdk4/types.rb', line 22344

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.



22357
22358
22359
22360
22361
22362
22363
22364
22365
# File 'lib/ovirtsdk4/types.rb', line 22357

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)


22099
22100
22101
# File 'lib/ovirtsdk4/types.rb', line 22099

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


22108
22109
22110
# File 'lib/ovirtsdk4/types.rb', line 22108

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


22117
22118
22119
# File 'lib/ovirtsdk4/types.rb', line 22117

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


22126
22127
22128
# File 'lib/ovirtsdk4/types.rb', line 22126

def description=(value)
  @description = value
end

#groupGroup

Returns the value of the group attribute.

Returns:



22135
22136
22137
# File 'lib/ovirtsdk4/types.rb', line 22135

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:



22148
22149
22150
22151
22152
22153
# File 'lib/ovirtsdk4/types.rb', line 22148

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

#hashObject

Generates a hash value for this object.



22370
22371
22372
22373
22374
22375
22376
22377
22378
# File 'lib/ovirtsdk4/types.rb', line 22370

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:



22160
22161
22162
# File 'lib/ovirtsdk4/types.rb', line 22160

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)


22173
22174
22175
22176
22177
22178
# File 'lib/ovirtsdk4/types.rb', line 22173

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)


22185
22186
22187
# File 'lib/ovirtsdk4/types.rb', line 22185

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


22194
22195
22196
# File 'lib/ovirtsdk4/types.rb', line 22194

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


22203
22204
22205
# File 'lib/ovirtsdk4/types.rb', line 22203

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


22212
22213
22214
# File 'lib/ovirtsdk4/types.rb', line 22212

def name=(value)
  @name = value
end

#parentTag

Returns the value of the parent attribute.

Returns:



22221
22222
22223
# File 'lib/ovirtsdk4/types.rb', line 22221

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)


22234
22235
22236
22237
22238
22239
# File 'lib/ovirtsdk4/types.rb', line 22234

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:



22246
22247
22248
# File 'lib/ovirtsdk4/types.rb', line 22246

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:



22259
22260
22261
22262
22263
22264
# File 'lib/ovirtsdk4/types.rb', line 22259

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:



22271
22272
22273
# File 'lib/ovirtsdk4/types.rb', line 22271

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)


22284
22285
22286
22287
22288
22289
# File 'lib/ovirtsdk4/types.rb', line 22284

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:



22296
22297
22298
# File 'lib/ovirtsdk4/types.rb', line 22296

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)


22309
22310
22311
22312
22313
22314
# File 'lib/ovirtsdk4/types.rb', line 22309

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