Class: OvirtSDK4::Ip

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

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

  • :address (String)

    The value of attribute address.

  • :gateway (String)

    The value of attribute gateway.

  • :netmask (String)

    The value of attribute netmask.

  • :version (IpVersion)

    The value of attribute version.



6613
6614
6615
6616
6617
6618
6619
# File 'lib/ovirtsdk4/types.rb', line 6613

def initialize(opts = {})
  super(opts)
  self.address = opts[:address]
  self.gateway = opts[:gateway]
  self.netmask = opts[:netmask]
  self.version = opts[:version]
end

Instance Method Details

#==(other) ⇒ Object

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



6624
6625
6626
6627
6628
6629
6630
# File 'lib/ovirtsdk4/types.rb', line 6624

def ==(other)
  super &&
  @address == other.address &&
  @gateway == other.gateway &&
  @netmask == other.netmask &&
  @version == other.version
end

#addressString

Returns the value of the address attribute.

Returns:

  • (String)


6530
6531
6532
# File 'lib/ovirtsdk4/types.rb', line 6530

def address
  @address
end

#address=(value) ⇒ Object

Sets the value of the address attribute.

Parameters:

  • value (String)


6539
6540
6541
# File 'lib/ovirtsdk4/types.rb', line 6539

def address=(value)
  @address = value
end

#gatewayString

Returns the value of the gateway attribute.

Returns:

  • (String)


6548
6549
6550
# File 'lib/ovirtsdk4/types.rb', line 6548

def gateway
  @gateway
end

#gateway=(value) ⇒ Object

Sets the value of the gateway attribute.

Parameters:

  • value (String)


6557
6558
6559
# File 'lib/ovirtsdk4/types.rb', line 6557

def gateway=(value)
  @gateway = value
end

#hashObject

Generates a hash value for this object.



6635
6636
6637
6638
6639
6640
6641
# File 'lib/ovirtsdk4/types.rb', line 6635

def hash
  super +
  @address.hash +
  @gateway.hash +
  @netmask.hash +
  @version.hash
end

#netmaskString

Returns the value of the netmask attribute.

Returns:

  • (String)


6566
6567
6568
# File 'lib/ovirtsdk4/types.rb', line 6566

def netmask
  @netmask
end

#netmask=(value) ⇒ Object

Sets the value of the netmask attribute.

Parameters:

  • value (String)


6575
6576
6577
# File 'lib/ovirtsdk4/types.rb', line 6575

def netmask=(value)
  @netmask = value
end

#versionIpVersion

Returns the value of the version attribute.

Returns:



6584
6585
6586
# File 'lib/ovirtsdk4/types.rb', line 6584

def version
  @version
end

#version=(value) ⇒ Object

Sets the value of the version attribute.

Parameters:



6593
6594
6595
# File 'lib/ovirtsdk4/types.rb', line 6593

def version=(value)
  @version = value
end