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



853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
# File 'lib/Qt/qtruby4.rb', line 853

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



884
885
886
# File 'lib/Qt/qtruby4.rb', line 884

def error
  return @error
end

#isValidObject



872
873
874
# File 'lib/Qt/qtruby4.rb', line 872

def isValid
  return !@error.isValid
end

#valid?Boolean

Returns:



876
877
878
# File 'lib/Qt/qtruby4.rb', line 876

def valid?
  return !@error.isValid
end

#valueObject



880
881
882
# File 'lib/Qt/qtruby4.rb', line 880

def value
  return @data.value
end