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

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

Overview

JSON-RPC error objects.

Constant Summary

Constants inherited from Object

Object::OPTIONS

Instance Attribute Summary collapse

Attributes inherited from Object

#context

Instance Method Summary collapse

Methods inherited from Object

#initialize, parse, #to_json

Constructor Details

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

Instance Attribute Details

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

#dataObject

Returns the value of attribute data.



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

def data
  @data
end

#messageObject

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

#to_hashHash

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