Class: OvirtSDK4::Role

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

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

  • :mutable (Boolean)

    The value of attribute mutable.

  • :name (String)

    The value of attribute name.

  • :permits (Array<Permit>, Array<Hash>)

    The values of attribute permits.

  • :user (User, Hash)

    The value of attribute user.


18174
18175
18176
18177
18178
18179
18180
# File 'lib/ovirtsdk4/types.rb', line 18174

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

Instance Method Details

#==(other) ⇒ Object

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


18185
18186
18187
18188
18189
18190
18191
# File 'lib/ovirtsdk4/types.rb', line 18185

def ==(other)
  super &&
  @administrative == other.administrative &&
  @mutable == other.mutable &&
  @permits == other.permits &&
  @user == other.user
end

#administrativeBoolean

Returns the value of the administrative attribute.

Returns:

  • (Boolean)

17996
17997
17998
# File 'lib/ovirtsdk4/types.rb', line 17996

def administrative
  @administrative
end

#administrative=(value) ⇒ Object

Sets the value of the administrative attribute.

Parameters:

  • value (Boolean)

18005
18006
18007
# File 'lib/ovirtsdk4/types.rb', line 18005

def administrative=(value)
  @administrative = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

18014
18015
18016
# File 'lib/ovirtsdk4/types.rb', line 18014

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

18023
18024
18025
# File 'lib/ovirtsdk4/types.rb', line 18023

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

18032
18033
18034
# File 'lib/ovirtsdk4/types.rb', line 18032

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

18041
18042
18043
# File 'lib/ovirtsdk4/types.rb', line 18041

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


18196
18197
18198
18199
18200
18201
18202
# File 'lib/ovirtsdk4/types.rb', line 18196

def hash
  super +
  @administrative.hash +
  @mutable.hash +
  @permits.hash +
  @user.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

18050
18051
18052
# File 'lib/ovirtsdk4/types.rb', line 18050

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

18059
18060
18061
# File 'lib/ovirtsdk4/types.rb', line 18059

def id=(value)
  @id = value
end

#mutableBoolean

Returns the value of the mutable attribute.

Returns:

  • (Boolean)

18068
18069
18070
# File 'lib/ovirtsdk4/types.rb', line 18068

def mutable
  @mutable
end

#mutable=(value) ⇒ Object

Sets the value of the mutable attribute.

Parameters:

  • value (Boolean)

18077
18078
18079
# File 'lib/ovirtsdk4/types.rb', line 18077

def mutable=(value)
  @mutable = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

18086
18087
18088
# File 'lib/ovirtsdk4/types.rb', line 18086

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

18095
18096
18097
# File 'lib/ovirtsdk4/types.rb', line 18095

def name=(value)
  @name = value
end

#permitsArray<Permit>

Returns the value of the permits attribute.

Returns:


18104
18105
18106
# File 'lib/ovirtsdk4/types.rb', line 18104

def permits
  @permits
end

#permits=(list) ⇒ Object

Sets the value of the permits attribute.

Parameters:


18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
# File 'lib/ovirtsdk4/types.rb', line 18113

def permits=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Permit.new(value)
      end
    end
  end
  @permits = list
end

#userUser

Returns the value of the user attribute.

Returns:


18130
18131
18132
# File 'lib/ovirtsdk4/types.rb', line 18130

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)

18143
18144
18145
18146
18147
18148
# File 'lib/ovirtsdk4/types.rb', line 18143

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