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.



17815
17816
17817
17818
17819
17820
17821
# File 'lib/ovirtsdk4/types.rb', line 17815

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.



17826
17827
17828
17829
17830
17831
17832
# File 'lib/ovirtsdk4/types.rb', line 17826

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)


17637
17638
17639
# File 'lib/ovirtsdk4/types.rb', line 17637

def administrative
  @administrative
end

#administrative=(value) ⇒ Object

Sets the value of the administrative attribute.

Parameters:

  • value (Boolean)


17646
17647
17648
# File 'lib/ovirtsdk4/types.rb', line 17646

def administrative=(value)
  @administrative = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


17655
17656
17657
# File 'lib/ovirtsdk4/types.rb', line 17655

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


17664
17665
17666
# File 'lib/ovirtsdk4/types.rb', line 17664

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


17673
17674
17675
# File 'lib/ovirtsdk4/types.rb', line 17673

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


17682
17683
17684
# File 'lib/ovirtsdk4/types.rb', line 17682

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



17837
17838
17839
17840
17841
17842
17843
# File 'lib/ovirtsdk4/types.rb', line 17837

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


17691
17692
17693
# File 'lib/ovirtsdk4/types.rb', line 17691

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


17700
17701
17702
# File 'lib/ovirtsdk4/types.rb', line 17700

def id=(value)
  @id = value
end

#mutableBoolean

Returns the value of the mutable attribute.

Returns:

  • (Boolean)


17709
17710
17711
# File 'lib/ovirtsdk4/types.rb', line 17709

def mutable
  @mutable
end

#mutable=(value) ⇒ Object

Sets the value of the mutable attribute.

Parameters:

  • value (Boolean)


17718
17719
17720
# File 'lib/ovirtsdk4/types.rb', line 17718

def mutable=(value)
  @mutable = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


17727
17728
17729
# File 'lib/ovirtsdk4/types.rb', line 17727

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


17736
17737
17738
# File 'lib/ovirtsdk4/types.rb', line 17736

def name=(value)
  @name = value
end

#permitsArray<Permit>

Returns the value of the permits attribute.

Returns:



17745
17746
17747
# File 'lib/ovirtsdk4/types.rb', line 17745

def permits
  @permits
end

#permits=(list) ⇒ Object

Sets the value of the permits attribute.

Parameters:



17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
# File 'lib/ovirtsdk4/types.rb', line 17754

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:



17771
17772
17773
# File 'lib/ovirtsdk4/types.rb', line 17771

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)


17784
17785
17786
17787
17788
17789
# File 'lib/ovirtsdk4/types.rb', line 17784

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