Class: OvirtSDK4::MacPool

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

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

  • :allow_duplicates (Boolean)

    The value of attribute allow_duplicates.

  • :comment (String)

    The value of attribute comment.

  • :default_pool (Boolean)

    The value of attribute default_pool.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :permissions (Array<Permission>, Array<Hash>)

    The values of attribute permissions.

  • :ranges (Array<Range>, Array<Hash>)

    The values of attribute ranges.



9150
9151
9152
9153
9154
9155
9156
# File 'lib/ovirtsdk4/types.rb', line 9150

def initialize(opts = {})
  super(opts)
  self.allow_duplicates = opts[:allow_duplicates]
  self.default_pool = opts[:default_pool]
  self.permissions = opts[:permissions]
  self.ranges = opts[:ranges]
end

Instance Method Details

#==(other) ⇒ Object

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



9161
9162
9163
9164
9165
9166
9167
# File 'lib/ovirtsdk4/types.rb', line 9161

def ==(other)
  super &&
  @allow_duplicates == other.allow_duplicates &&
  @default_pool == other.default_pool &&
  @permissions == other.permissions &&
  @ranges == other.ranges
end

#allow_duplicatesBoolean

Returns the value of the allow_duplicates attribute.

Returns:

  • (Boolean)


8971
8972
8973
# File 'lib/ovirtsdk4/types.rb', line 8971

def allow_duplicates
  @allow_duplicates
end

#allow_duplicates=(value) ⇒ Object

Sets the value of the allow_duplicates attribute.

Parameters:

  • value (Boolean)


8980
8981
8982
# File 'lib/ovirtsdk4/types.rb', line 8980

def allow_duplicates=(value)
  @allow_duplicates = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


8989
8990
8991
# File 'lib/ovirtsdk4/types.rb', line 8989

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


8998
8999
9000
# File 'lib/ovirtsdk4/types.rb', line 8998

def comment=(value)
  @comment = value
end

#default_poolBoolean

Returns the value of the default_pool attribute.

Returns:

  • (Boolean)


9007
9008
9009
# File 'lib/ovirtsdk4/types.rb', line 9007

def default_pool
  @default_pool
end

#default_pool=(value) ⇒ Object

Sets the value of the default_pool attribute.

Parameters:

  • value (Boolean)


9016
9017
9018
# File 'lib/ovirtsdk4/types.rb', line 9016

def default_pool=(value)
  @default_pool = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


9025
9026
9027
# File 'lib/ovirtsdk4/types.rb', line 9025

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


9034
9035
9036
# File 'lib/ovirtsdk4/types.rb', line 9034

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



9172
9173
9174
9175
9176
9177
9178
# File 'lib/ovirtsdk4/types.rb', line 9172

def hash
  super +
  @allow_duplicates.hash +
  @default_pool.hash +
  @permissions.hash +
  @ranges.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


9043
9044
9045
# File 'lib/ovirtsdk4/types.rb', line 9043

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


9052
9053
9054
# File 'lib/ovirtsdk4/types.rb', line 9052

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


9061
9062
9063
# File 'lib/ovirtsdk4/types.rb', line 9061

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


9070
9071
9072
# File 'lib/ovirtsdk4/types.rb', line 9070

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



9079
9080
9081
# File 'lib/ovirtsdk4/types.rb', line 9079

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
# File 'lib/ovirtsdk4/types.rb', line 9088

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

#rangesArray<Range>

Returns the value of the ranges attribute.

Returns:



9105
9106
9107
# File 'lib/ovirtsdk4/types.rb', line 9105

def ranges
  @ranges
end

#ranges=(list) ⇒ Object

Sets the value of the ranges attribute.

Parameters:



9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
# File 'lib/ovirtsdk4/types.rb', line 9114

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