Class: OvirtSDK4::Permit

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

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

  • :administrative (Boolean)

    The value of attribute administrative.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :role (Role, Hash)

    The value of attribute role.


14096
14097
14098
14099
14100
# File 'lib/ovirtsdk4/types.rb', line 14096

def initialize(opts = {})
  super(opts)
  self.administrative = opts[:administrative]
  self.role = opts[:role]
end

Instance Method Details

#==(other) ⇒ Object

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


14105
14106
14107
14108
14109
# File 'lib/ovirtsdk4/types.rb', line 14105

def ==(other)
  super &&
  @administrative == other.administrative &&
  @role == other.role
end

#administrativeBoolean

Returns the value of the administrative attribute.

Returns:

  • (Boolean)

13966
13967
13968
# File 'lib/ovirtsdk4/types.rb', line 13966

def administrative
  @administrative
end

#administrative=(value) ⇒ Object

Sets the value of the administrative attribute.

Parameters:

  • value (Boolean)

13975
13976
13977
# File 'lib/ovirtsdk4/types.rb', line 13975

def administrative=(value)
  @administrative = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

13984
13985
13986
# File 'lib/ovirtsdk4/types.rb', line 13984

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

13993
13994
13995
# File 'lib/ovirtsdk4/types.rb', line 13993

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

14002
14003
14004
# File 'lib/ovirtsdk4/types.rb', line 14002

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

14011
14012
14013
# File 'lib/ovirtsdk4/types.rb', line 14011

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


14114
14115
14116
14117
14118
# File 'lib/ovirtsdk4/types.rb', line 14114

def hash
  super +
  @administrative.hash +
  @role.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

14020
14021
14022
# File 'lib/ovirtsdk4/types.rb', line 14020

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

14029
14030
14031
# File 'lib/ovirtsdk4/types.rb', line 14029

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

14038
14039
14040
# File 'lib/ovirtsdk4/types.rb', line 14038

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

14047
14048
14049
# File 'lib/ovirtsdk4/types.rb', line 14047

def name=(value)
  @name = value
end

#roleRole

Returns the value of the role attribute.

Returns:


14056
14057
14058
# File 'lib/ovirtsdk4/types.rb', line 14056

def role
  @role
end

#role=(value) ⇒ Object

Sets the value of the role attribute.

The value parameter can be an instance of Role 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 (Role, Hash)

14069
14070
14071
14072
14073
14074
# File 'lib/ovirtsdk4/types.rb', line 14069

def role=(value)
  if value.is_a?(Hash)
    value = Role.new(value)
  end
  @role = value
end