Class: Rack::RPC::Endpoint::JSONRPC::Error

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

Overview

JSON-RPC error objects.

Direct Known Subclasses

ArgumentError, ClientError, InternalError, NoMethodError, ParseError, ServerError

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

- (void) code

Returns the value of attribute code



216
217
218
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 216

def code
  @code
end

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

An arbitrary context associated with the object.

Returns:

- (void) data

Returns the value of attribute data



218
219
220
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 218

def data
  @data
end

- (void) message

Returns the value of attribute message



217
218
219
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 217

def message
  @message
end

Instance Method Details

- (Hash) to_hash

Returns:

  • (Hash)


222
223
224
225
226
227
228
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 222

def to_hash
  {
    :code    => code.to_i,
    :message => message.to_s,
    :data    => data,
  }
end