Class: Rack::RPC::Endpoint::JSONRPC::Request

Inherits:
Notification show all
Defined in:
lib/rack/rpc/endpoint/jsonrpc.rb

Overview

JSON-RPC request objects.

Constant Summary

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

This class inherits a constructor from Rack::RPC::Endpoint::JSONRPC::Object

Instance Attribute Details

- (Object) context (readonly) Originally defined in class Object

An arbitrary context associated with the object.

Returns:

- (void) id

Returns the value of attribute id



169
170
171
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 169

def id
  @id
end

- (void) method Originally defined in class Notification

Returns the value of attribute method

- (void) params Originally defined in class Notification

Returns the value of attribute params

- (void) version Originally defined in class Notification

Returns the value of attribute version

Instance Method Details

- (Array) to_args

Returns:

  • (Array)


187
188
189
190
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 187

def to_args
  # used from Operation#initialize
  params
end

- (Hash) to_hash

Returns:

  • (Hash)


179
180
181
182
183
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 179

def to_hash
  super.merge({
    :id => id,
  })
end

- (Boolean) valid?

Returns:

  • (Boolean)


173
174
175
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 173

def valid?
  super && !id.nil?
end