Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitboxer/jimson
JSON-RPC 2.0 client and server for Ruby
https://github.com/bitboxer/jimson
Last synced: about 7 hours ago
JSON representation
JSON-RPC 2.0 client and server for Ruby
- Host: GitHub
- URL: https://github.com/bitboxer/jimson
- Owner: bitboxer
- License: mit
- Created: 2011-07-13T22:04:16.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T14:43:17.000Z (9 months ago)
- Last Synced: 2025-01-01T12:07:06.365Z (7 days ago)
- Language: Ruby
- Homepage:
- Size: 147 KB
- Stars: 134
- Watchers: 8
- Forks: 62
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Jimson
### [JSON-RPC 2.0](https://www.jsonrpc.org/specification) Client and Server for Ruby
[![Build Status](https://github.com/chriskite/jimson/actions/workflows/ruby.yml/badge.svg?branch=main)](https://github.com/chriskite/jimson/actions/workflows/ruby.yml)
## Client: Quick Start
```ruby
require 'jimson'
client = Jimson::Client.new("http://www.example.com:8999") # the URL for the JSON-RPC 2.0 server to connect to
result = client.sum(1,2) # call the 'sum' method on the RPC server and save the result '3'
```## Server: Quick Start
```ruby
require 'jimson'class MyHandler
extend Jimson::Handlerdef sum(a,b)
a + b
end
endserver = Jimson::Server.new(MyHandler.new)
server.start # serve with webrick on http://0.0.0.0:8999/
```## JSON Engine
Jimson uses [multi\_json](https://github.com/intridea/multi_json), so you can load the JSON library of your choice in your application and Jimson will use it automatically.
For example, require the 'json' gem in your application:
```ruby
require 'json'
```## Previous maintainer
This gem was maintained by [Chris Kite](https://github.com/chriskite/) till April 2021.