class QRPC::Protocol::JsonRpc::Request
JSON-RPC request implementation. @since 0.9.0
Attributes
native[W]
Holds native object.
Public Class Methods
parse(raw)
click to toggle source
Parses the data for new object.
@param [String] raw raw data @return [Request] new request according to data
# File lib/qrpc/protocol/json-rpc/request.rb, line 50 def self.parse(raw) object = self::new object.native = JsonRpcObjects::Request::parse(raw, :wd, self::options.serializer) return object end
Public Instance Methods
client()
click to toggle source
Returns the QRPC
request client identifier. @return [Object]
# File lib/qrpc/protocol/json-rpc/request.rb, line 125 def client @native.qrpc["client"] end
id()
click to toggle source
Returns ID of the request. @return [Object] request ID
# File lib/qrpc/protocol/json-rpc/request.rb, line 89 def id self.native.id end
method()
click to toggle source
Returns method identifier of the request. @return [Symbol]
# File lib/qrpc/protocol/json-rpc/request.rb, line 98 def method @native.method end
native()
click to toggle source
Returns the native object. @return [JsonRpcObjects::Response] native response object
# File lib/qrpc/protocol/json-rpc/request.rb, line 62 def native if @native.nil? client_id = @options.client_id.to_s qrpc = QRPC::Protocol::JsonRpc::Native::QrpcObject::create(:client => client_id, :priority => @options.priority, :notification => @options.notification) qrpc.serializer = @options.serializer @native = JsonRpcObjects::Request::create(@options[:method], @options.arguments, :id => @options.id, :qrpc => qrpc.output) @native.serializer = @options.serializer end @native end
notification?()
click to toggle source
Indicates, job is notification. @return [Boolean]
# File lib/qrpc/protocol/json-rpc/request.rb, line 134 def notification? @native.qrpc["notification"] end
params()
click to toggle source
Returns method params of the request. @return [Array]
# File lib/qrpc/protocol/json-rpc/request.rb, line 107 def params @native.params end
priority()
click to toggle source
Returns the QRPC
request priority. @return [Integer]
# File lib/qrpc/protocol/json-rpc/request.rb, line 116 def priority @native.qrpc["priority"] end
serialize()
click to toggle source
Serializes object to the resultant form. @return [String] serialized form
# File lib/qrpc/protocol/json-rpc/request.rb, line 80 def serialize self.native.serialize end