Class: OvirtSDK4::SshPublicKey

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

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

  • :content (String)

    The value of attribute content.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :user (User, Hash)

    The value of attribute user.


19606
19607
19608
19609
19610
# File 'lib/ovirtsdk4/types.rb', line 19606

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

Instance Method Details

#==(other) ⇒ Object

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


19615
19616
19617
19618
19619
# File 'lib/ovirtsdk4/types.rb', line 19615

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

19476
19477
19478
# File 'lib/ovirtsdk4/types.rb', line 19476

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

19485
19486
19487
# File 'lib/ovirtsdk4/types.rb', line 19485

def comment=(value)
  @comment = value
end

#contentString

Returns the value of the content attribute.

Returns:

  • (String)

19494
19495
19496
# File 'lib/ovirtsdk4/types.rb', line 19494

def content
  @content
end

#content=(value) ⇒ Object

Sets the value of the content attribute.

Parameters:

  • value (String)

19503
19504
19505
# File 'lib/ovirtsdk4/types.rb', line 19503

def content=(value)
  @content = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

19512
19513
19514
# File 'lib/ovirtsdk4/types.rb', line 19512

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

19521
19522
19523
# File 'lib/ovirtsdk4/types.rb', line 19521

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


19624
19625
19626
19627
19628
# File 'lib/ovirtsdk4/types.rb', line 19624

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)

19530
19531
19532
# File 'lib/ovirtsdk4/types.rb', line 19530

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

19539
19540
19541
# File 'lib/ovirtsdk4/types.rb', line 19539

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

19548
19549
19550
# File 'lib/ovirtsdk4/types.rb', line 19548

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

19557
19558
19559
# File 'lib/ovirtsdk4/types.rb', line 19557

def name=(value)
  @name = value
end

#userUser

Returns the value of the user attribute.

Returns:


19566
19567
19568
# File 'lib/ovirtsdk4/types.rb', line 19566

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)

19579
19580
19581
19582
19583
19584
# File 'lib/ovirtsdk4/types.rb', line 19579

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