Class: Qt::DBusReply

Inherits:
Object show all
Defined in:
lib/qt/qtruby4.rb

Instance Method Summary collapse

Constructor Details

#initialize(reply) ⇒ DBusReply

Returns a new instance of DBusReply.



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'lib/qt/qtruby4.rb', line 513

def initialize(reply)
	@error = Qt::DBusError.new(reply)

	if @error.valid?
		@data = Qt::Variant.new
		return
	end

	if reply.arguments.length >= 1
		@data = reply.arguments[0]
		return
	end
	
	# error
	@error = Qt::DBusError.new(	Qt::DBusError::InvalidSignature, 
								"Unexpected reply signature" )
	@data = Qt::Variant.new      # clear it
end

Instance Method Details

#errorObject



544
545
546
# File 'lib/qt/qtruby4.rb', line 544

def error
	return @error
end

#isValidObject



532
533
534
# File 'lib/qt/qtruby4.rb', line 532

def isValid
	return !@error.isValid
end

#valid?Boolean

Returns:



536
537
538
# File 'lib/qt/qtruby4.rb', line 536

def valid?
	return !@error.isValid
end

#valueObject



540
541
542
# File 'lib/qt/qtruby4.rb', line 540

def value
	return @data.value
end