Class: OvirtSDK4::Core

Inherits:
Struct
  • Object
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 = {}) ⇒ Core

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

  • :index (Integer)

    The value of attribute index.

  • :socket (Integer)

    The value of attribute socket.


2168
2169
2170
2171
2172
# File 'lib/ovirtsdk4/types.rb', line 2168

def initialize(opts = {})
  super(opts)
  self.index = opts[:index]
  self.socket = opts[:socket]
end

Instance Method Details

#==(other) ⇒ Object

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


2177
2178
2179
2180
2181
# File 'lib/ovirtsdk4/types.rb', line 2177

def ==(other)
  super &&
  @index == other.index &&
  @socket == other.socket
end

#hashObject

Generates a hash value for this object.


2186
2187
2188
2189
2190
# File 'lib/ovirtsdk4/types.rb', line 2186

def hash
  super +
  @index.hash +
  @socket.hash
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)

2125
2126
2127
# File 'lib/ovirtsdk4/types.rb', line 2125

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)

2134
2135
2136
# File 'lib/ovirtsdk4/types.rb', line 2134

def index=(value)
  @index = value
end

#socketInteger

Returns the value of the socket attribute.

Returns:

  • (Integer)

2143
2144
2145
# File 'lib/ovirtsdk4/types.rb', line 2143

def socket
  @socket
end

#socket=(value) ⇒ Object

Sets the value of the socket attribute.

Parameters:

  • value (Integer)

2152
2153
2154
# File 'lib/ovirtsdk4/types.rb', line 2152

def socket=(value)
  @socket = value
end