Class: OvirtSDK4::AuthorizedKey

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

Creates a new instance of the OvirtSDK4::AuthorizedKey class.

Options Hash (opts):

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :key (String)

    The value of attribute key.

  • :name (String)

    The value of attribute name.

  • :user (User, Hash)

    The value of attribute user.



32577
32578
32579
32580
32581
# File 'lib/ovirtsdk4/types.rb', line 32577

def initialize(opts = {})
  super(opts)
  self.key = opts[:key]
  self.user = opts[:user]
end

Instance Method Details

#==(other) ⇒ Object

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



32586
32587
32588
32589
32590
# File 'lib/ovirtsdk4/types.rb', line 32586

def ==(other)
  super &&
  @key == other.key &&
  @user == other.user
end

#commentString

Returns the value of the comment attribute.



32447
32448
32449
# File 'lib/ovirtsdk4/types.rb', line 32447

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



32456
32457
32458
# File 'lib/ovirtsdk4/types.rb', line 32456

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



32465
32466
32467
# File 'lib/ovirtsdk4/types.rb', line 32465

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



32474
32475
32476
# File 'lib/ovirtsdk4/types.rb', line 32474

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



32595
32596
32597
32598
32599
# File 'lib/ovirtsdk4/types.rb', line 32595

def hash
  super +
  @key.hash +
  @user.hash
end

#idString

Returns the value of the id attribute.



32483
32484
32485
# File 'lib/ovirtsdk4/types.rb', line 32483

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



32492
32493
32494
# File 'lib/ovirtsdk4/types.rb', line 32492

def id=(value)
  @id = value
end

#keyString

Returns the value of the key attribute.



32501
32502
32503
# File 'lib/ovirtsdk4/types.rb', line 32501

def key
  @key
end

#key=(value) ⇒ Object

Sets the value of the key attribute.



32510
32511
32512
# File 'lib/ovirtsdk4/types.rb', line 32510

def key=(value)
  @key = value
end

#nameString

Returns the value of the name attribute.



32519
32520
32521
# File 'lib/ovirtsdk4/types.rb', line 32519

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



32528
32529
32530
# File 'lib/ovirtsdk4/types.rb', line 32528

def name=(value)
  @name = value
end

#userUser

Returns the value of the user attribute.



32537
32538
32539
# File 'lib/ovirtsdk4/types.rb', line 32537

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.



32550
32551
32552
32553
32554
32555
# File 'lib/ovirtsdk4/types.rb', line 32550

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