RubyGems Navigation menu

jsonrpc2 0.0.1

JSON-RPC2 server DSL - allows APIs to be created as mountable Rack applications with inline documentation, authentication and type checking. e.g. class Calculator < JSONRPC2::Interface title "JSON-RPC2 Calculator" introduction "This interface allows basic maths calculations via JSON-RPC2" auth_with JSONRPC2::BasicAuth.new({'user' => 'secretword'}) section 'Simple Ops' do desc 'Multiply two numbers' param 'a', 'Number', 'a' param 'b', 'Number', 'b' result 'Number', 'a * b' def mul args args['a'] * args['b'] end desc 'Add numbers' example "Calculate 1 + 1 = 2", :params => { 'a' => 1, 'b' => 1}, :result => 2 param 'a', 'Number', 'First number' param 'b', 'Number', 'Second number' optional 'c', 'Number', 'Third number' result 'Number', 'a + b + c' def sum args val = args['a'] + args['b'] val += args['c'] if args['c'] val end end end

Gemfile:
=

installation:
=

Versions:

  1. 0.3.0 February 10, 2023 (132 ko)
  2. 0.2.0 April 14, 2022 (132 ko)
  3. 0.1.1 January 04, 2014 (128 ko)
  4. 0.1.0 January 04, 2014 (127 ko)
  5. 0.0.9 September 03, 2012 (94,5 ko)
  6. 0.0.1 July 17, 2012 (14,5 ko)
Voir toutes les versions (13)

Dépendances de Runtime (2):

httpclient >= 0
json >= 0

Dépendances de Development (1):

RedCloth >= 0

Propriétaires:

Auteurs:

  • Geoff Youngs

Total de contrôle SHA 256:

=

Total de téléchargements 44 658

Pour cette version 3 108

Version publiée:

License:

aucune

Version de Ruby requise: None

Liens: