Exception: GirFFI::GLibError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/gir_ffi/glib_error.rb

Overview

Exception class to be raised whenever an error is signaled through GLib::Error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(g_error) ⇒ GLibError

Returns a new instance of GLibError.



10
11
12
13
14
# File 'lib/gir_ffi/glib_error.rb', line 10

def initialize(g_error)
  @domain_quark = g_error.domain
  @code = g_error.code
  super g_error.message
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/gir_ffi/glib_error.rb', line 8

def code
  @code
end

#domain_quarkObject (readonly)

Returns the value of attribute domain_quark.



7
8
9
# File 'lib/gir_ffi/glib_error.rb', line 7

def domain_quark
  @domain_quark
end

Instance Method Details

#domainObject



16
17
18
# File 'lib/gir_ffi/glib_error.rb', line 16

def domain
  @domain ||= GLib.quark_to_string @domain_quark
end