Class: Isaca::Model::AuthenticateUser

Inherits:
Object
  • Object
show all
Defined in:
lib/isaca/models/authenticate_user.rb

Overview

Class that is used as an object representation of the response from Request::AuthenticateUser.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ AuthenticateUser

Returns a new instance of AuthenticateUser.

Parameters:

  • params (Hash)

    Parameters to create the object with.

Options Hash (params):

  • :Error (String)

    Required

  • :ErrorCode (String)

    Required

  • :IsValid (String)

    Required

  • :Value (String)

    Required

Raises:



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/isaca/models/authenticate_user.rb', line 23

def initialize(params)
  raise AttributeError.new(:Error, self.class.name, params) unless params.has_key?(:Error)
  raise AttributeError.new(:ErrorCode, self.class.name, params) unless params.has_key?(:ErrorCode)
  raise AttributeError.new(:IsValid, self.class.name, params) unless params.has_key?(:IsValid)
  raise AttributeError.new(:Value, self.class.name, params) unless params.has_key?(:Value)

  @error = params[:Error]
  @error_code = params[:ErrorCode]
  @is_valid = Isaca::Helpers.parse_boolean params[:IsValid]
  @value = params[:Value]
end

Instance Attribute Details

#errorArray

Returns The ISACA error – ISACA documentation on this is currently limited.

Returns:

  • (Array)

    The ISACA error – ISACA documentation on this is currently limited.



8
9
10
# File 'lib/isaca/models/authenticate_user.rb', line 8

def error
  @error
end

#error_codeString

Returns The ISACA error code – ISACA documentation on this is currently limited.

Returns:

  • (String)

    The ISACA error code – ISACA documentation on this is currently limited.



8
9
10
# File 'lib/isaca/models/authenticate_user.rb', line 8

def error_code
  @error_code
end

#is_validBoolean

Returns Whether or not the session is valid.

Returns:

  • (Boolean)

    Whether or not the session is valid.



11
12
13
# File 'lib/isaca/models/authenticate_user.rb', line 11

def is_valid
  @is_valid
end

#valueString

Returns Session value or error message.

Returns:

  • (String)

    Session value or error message.



14
15
16
# File 'lib/isaca/models/authenticate_user.rb', line 14

def value
  @value
end

Instance Method Details

#is_valid?Boolean

Helper method for checking the validity of a session

Returns:

  • (Boolean)


38
39
40
# File 'lib/isaca/models/authenticate_user.rb', line 38

def is_valid?
  is_valid
end