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.



832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
# File 'lib/Qt/qtruby4.rb', line 832

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



863
864
865
# File 'lib/Qt/qtruby4.rb', line 863

def error
  return @error
end

#isValidObject



851
852
853
# File 'lib/Qt/qtruby4.rb', line 851

def isValid
  return !@error.isValid
end

#valid?Boolean

Returns:



855
856
857
# File 'lib/Qt/qtruby4.rb', line 855

def valid?
  return !@error.isValid
end

#valueObject



859
860
861
# File 'lib/Qt/qtruby4.rb', line 859

def value
  return @data.value
end