Class: QRPC::Protocol::Abstract::Response Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/qrpc/protocol/abstract/response.rb

Overview

This class is abstract.

Abstract response implementation.

Since:

  • 0.9.0

Direct Known Subclasses

JsonRpc::Response, Object::Response

Instance Attribute Summary

Attributes inherited from Object

#options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#assign_options, #serialize

Constructor Details

#initialize(init = { }) ⇒ Response

This method is abstract.

Constructor.

Parameters:

  • init (Hash) (defaults to: { })

    initial options

Since:

  • 0.9.0



44
45
46
47
48
49
# File 'lib/qrpc/protocol/abstract/response.rb', line 44

def initialize(init = { })
    super(init)
    if self.instance_of? Response
        not_implemented
    end
end

Class Method Details

.parse(raw) ⇒ Response

This method is abstract.

Parses the data for new object.

Parameters:

  • raw (String)

    raw data

Returns:

  • (Response)

    new response according to data

Since:

  • 0.9.0



59
60
61
# File 'lib/qrpc/protocol/abstract/response.rb', line 59

def self.parse(raw)
    not_implemented
end

Instance Method Details

#errorException

Returns response error.

Returns:

  • (Exception)

    error object

Since:

  • 0.9.0



78
79
80
# File 'lib/qrpc/protocol/abstract/response.rb', line 78

def error
    not_implemented
end

#error?Boolean

Indicates, error state of the response.

Returns:

  • (Boolean)

    error indication

Since:

  • 0.9.0



87
88
89
# File 'lib/qrpc/protocol/abstract/response.rb', line 87

def error?
    not_implemented
end

#idObject

Returns ID of the request.

Returns:

Since:

  • 0.9.0



68
69
70
# File 'lib/qrpc/protocol/abstract/response.rb', line 68

def id
    not_implemented
end

#resultObject

Returns response result.

Returns:

  • (Object)

    response result

Since:

  • 0.9.0



96
97
98
# File 'lib/qrpc/protocol/abstract/response.rb', line 96

def result
    not_implemented
end