Class: QRPC::Protocol::Object::Request

Inherits:
Abstract::Request show all
Defined in:
lib/qrpc/protocol/object/request.rb

Overview

Object request implementation.

Since:

  • 0.9.0

Instance Attribute Summary

Attributes inherited from Abstract::Object

#options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Abstract::Request

#initialize

Methods inherited from Abstract::Object

#assign_options, #initialize

Constructor Details

This class inherits a constructor from QRPC::Protocol::Abstract::Request

Class Method Details

.parse(raw) ⇒ Request

Parses the data for new object.

Parameters:

  • raw (String)

    raw data

Returns:

  • (Request)

    new request according to data

Since:

  • 0.9.0



41
42
43
# File 'lib/qrpc/protocol/object/request.rb', line 41

def self.parse(raw)
    self::new(raw.options)
end

Instance Method Details

#clientObject

Returns the QRPC request client identifier.

Returns:

Since:

  • 0.9.0



95
96
97
# File 'lib/qrpc/protocol/object/request.rb', line 95

def client
    @options.client_id.to_s
end

#idObject

Returns ID of the request.

Returns:

Since:

  • 0.9.0



59
60
61
# File 'lib/qrpc/protocol/object/request.rb', line 59

def id
    @options.id
end

#methodSymbol

Returns method identifier of the request.

Returns:

  • (Symbol)

Since:

  • 0.9.0



68
69
70
# File 'lib/qrpc/protocol/object/request.rb', line 68

def method
    @options[:method]
end

#notification?Boolean

Indicates, job is notification.

Returns:

  • (Boolean)

Since:

  • 0.9.0



104
105
106
# File 'lib/qrpc/protocol/object/request.rb', line 104

def notification?
    @options.notification
end

#paramsArray

Returns method params of the request.

Returns:

  • (Array)

Since:

  • 0.9.0



77
78
79
# File 'lib/qrpc/protocol/object/request.rb', line 77

def params
    @options.arguments
end

#priorityInteger

Returns the QRPC request priority.

Returns:

  • (Integer)

Since:

  • 0.9.0



86
87
88
# File 'lib/qrpc/protocol/object/request.rb', line 86

def priority
    @options.priority
end

#serializeRequest

Serializes object to the resultant form.

Returns:

Since:

  • 0.9.0



50
51
52
# File 'lib/qrpc/protocol/object/request.rb', line 50

def serialize
    self
end