Class: Rack::RPC::Endpoint::JSONRPC::Notification

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

Overview

JSON-RPC notification objects.

Direct Known Subclasses

Request

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) method

Returns the value of attribute method



146
147
148
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 146

def method
  @method
end

- (void) params

Returns the value of attribute params



147
148
149
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 147

def params
  @params
end

- (void) version

Returns the value of attribute version



145
146
147
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 145

def version
  @version
end

Instance Method Details

- (Hash) to_hash

Returns:

  • (Hash)


157
158
159
160
161
162
163
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 157

def to_hash
  {
    :jsonrpc => (version || VERSION).to_s,
    :method  => method.to_s,
    :params  => params ? params.to_a : [], # NOTE: named arguments not supported
  }
end

- (Boolean) valid?

Returns:

  • (Boolean)


151
152
153
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 151

def valid?
  true # TODO
end