Class: OvirtSDK4::Session

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

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

  • :comment (String)

    The value of attribute comment.

  • :console_user (Boolean)

    The value of attribute console_user.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :ip (Ip, Hash)

    The value of attribute ip.

  • :name (String)

    The value of attribute name.

  • :protocol (String)

    The value of attribute protocol.

  • :user (User, Hash)

    The value of attribute user.

  • :vm (Vm, Hash)

    The value of attribute vm.


18930
18931
18932
18933
18934
18935
18936
18937
# File 'lib/ovirtsdk4/types.rb', line 18930

def initialize(opts = {})
  super(opts)
  self.console_user = opts[:console_user]
  self.ip = opts[:ip]
  self.protocol = opts[:protocol]
  self.user = opts[:user]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

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


18942
18943
18944
18945
18946
18947
18948
18949
# File 'lib/ovirtsdk4/types.rb', line 18942

def ==(other)
  super &&
  @console_user == other.console_user &&
  @ip == other.ip &&
  @protocol == other.protocol &&
  @user == other.user &&
  @vm == other.vm
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

18726
18727
18728
# File 'lib/ovirtsdk4/types.rb', line 18726

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

18735
18736
18737
# File 'lib/ovirtsdk4/types.rb', line 18735

def comment=(value)
  @comment = value
end

#console_userBoolean

Returns the value of the console_user attribute.

Returns:

  • (Boolean)

18744
18745
18746
# File 'lib/ovirtsdk4/types.rb', line 18744

def console_user
  @console_user
end

#console_user=(value) ⇒ Object

Sets the value of the console_user attribute.

Parameters:

  • value (Boolean)

18753
18754
18755
# File 'lib/ovirtsdk4/types.rb', line 18753

def console_user=(value)
  @console_user = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

18762
18763
18764
# File 'lib/ovirtsdk4/types.rb', line 18762

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

18771
18772
18773
# File 'lib/ovirtsdk4/types.rb', line 18771

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


18954
18955
18956
18957
18958
18959
18960
18961
# File 'lib/ovirtsdk4/types.rb', line 18954

def hash
  super +
  @console_user.hash +
  @ip.hash +
  @protocol.hash +
  @user.hash +
  @vm.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

18780
18781
18782
# File 'lib/ovirtsdk4/types.rb', line 18780

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

18789
18790
18791
# File 'lib/ovirtsdk4/types.rb', line 18789

def id=(value)
  @id = value
end

#ipIp

Returns the value of the ip attribute.

Returns:


18798
18799
18800
# File 'lib/ovirtsdk4/types.rb', line 18798

def ip
  @ip
end

#ip=(value) ⇒ Object

Sets the value of the ip attribute.

The value parameter can be an instance of Ip 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 (Ip, Hash)

18811
18812
18813
18814
18815
18816
# File 'lib/ovirtsdk4/types.rb', line 18811

def ip=(value)
  if value.is_a?(Hash)
    value = Ip.new(value)
  end
  @ip = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

18823
18824
18825
# File 'lib/ovirtsdk4/types.rb', line 18823

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

18832
18833
18834
# File 'lib/ovirtsdk4/types.rb', line 18832

def name=(value)
  @name = value
end

#protocolString

Returns the value of the protocol attribute.

Returns:

  • (String)

18841
18842
18843
# File 'lib/ovirtsdk4/types.rb', line 18841

def protocol
  @protocol
end

#protocol=(value) ⇒ Object

Sets the value of the protocol attribute.

Parameters:

  • value (String)

18850
18851
18852
# File 'lib/ovirtsdk4/types.rb', line 18850

def protocol=(value)
  @protocol = value
end

#userUser

Returns the value of the user attribute.

Returns:


18859
18860
18861
# File 'lib/ovirtsdk4/types.rb', line 18859

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)

18872
18873
18874
18875
18876
18877
# File 'lib/ovirtsdk4/types.rb', line 18872

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

#vmVm

Returns the value of the vm attribute.

Returns:


18884
18885
18886
# File 'lib/ovirtsdk4/types.rb', line 18884

def vm
  @vm
end

#vm=(value) ⇒ Object

Sets the value of the vm attribute.

The value parameter can be an instance of Vm 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 (Vm, Hash)

18897
18898
18899
18900
18901
18902
# File 'lib/ovirtsdk4/types.rb', line 18897

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end