Class: Informix::ExcInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/informix/exceptions.rb,
lib/informix/exceptions.rb

Overview

The ExcInfo class works as an object representation of an Informix error state

Constant Summary collapse

FORMAT =
"%-15s: %s\n".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_originObject

Returns the value of attribute class_origin

Returns:

  • (Object)

    the current value of class_origin



36
37
38
# File 'lib/informix/exceptions.rb', line 36

def class_origin
  @class_origin
end

#connection_nameObject

Returns the value of attribute connection_name

Returns:

  • (Object)

    the current value of connection_name



36
37
38
# File 'lib/informix/exceptions.rb', line 36

def connection_name
  @connection_name
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



36
37
38
# File 'lib/informix/exceptions.rb', line 36

def message
  @message
end

#server_nameObject

Returns the value of attribute server_name

Returns:

  • (Object)

    the current value of server_name



36
37
38
# File 'lib/informix/exceptions.rb', line 36

def server_name
  @server_name
end

#sql_codeObject

Returns the value of attribute sql_code

Returns:

  • (Object)

    the current value of sql_code



36
37
38
# File 'lib/informix/exceptions.rb', line 36

def sql_code
  @sql_code
end

#sql_stateObject

Returns the value of attribute sql_state

Returns:

  • (Object)

    the current value of sql_state



36
37
38
# File 'lib/informix/exceptions.rb', line 36

def sql_state
  @sql_state
end

#subclass_originObject

Returns the value of attribute subclass_origin

Returns:

  • (Object)

    the current value of subclass_origin



36
37
38
# File 'lib/informix/exceptions.rb', line 36

def subclass_origin
  @subclass_origin
end

Instance Method Details

#to_sObject

excinfo.to_s => string

Returns a string representation of the error.



47
48
49
50
51
52
53
# File 'lib/informix/exceptions.rb', line 47

def to_s
  ret = "\n"
  each_pair do |member, value|
    ret += sprintf(FORMAT, member.to_s, value)
  end
  ret
end