jsonrpc-rails 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 439108bab45d71dabc7ca40fa35042cdaecd7f3dc6988bc3a13fb0d825ef38ac
4
- data.tar.gz: 34142d82edff4b8099610d44ca19bc039571fbcc0651a44c24588047a141838a
3
+ metadata.gz: 93b8692cfb780990697a06219f80c323096bd5b12d21b95ec0a70e83dcbe555c
4
+ data.tar.gz: a3a15cc185bfb704d6a11cd2085be7beb291c20e727ef9cce317d4b993d5efc4
5
5
  SHA512:
6
- metadata.gz: a9b228edf10da4b05019c87643079e3ebe673fb98913dfba6567877293c28e8d2fd3a6507174d2aec8010d8254bab551631b38ac20e3784281773b4546bafb16
7
- data.tar.gz: 3a4cbec99a1dd380a32263d6db57b4550f030aa50c67f29af3b8b25f827dc7d8a5c2be600e282426f36b826a82d393d2a61adda782040aeb0a44f76a455d96ba
6
+ metadata.gz: 305bde8d1013629a31736c9da2de66a90e6d0e860311b784cbac65615646a24ae6460b1cb21699c8c79141027b65c8a988b6f20fbcdbad6d7e1425125fe458df
7
+ data.tar.gz: 232740f9c3756071955993b87f7f8ae4832d6159dd6273cd71a6b944003dbc1d68f32692addab5b3ea90d04bfc32908f4572da0791b778e7fdd8f4394abe640d
data/README.md CHANGED
@@ -111,9 +111,9 @@ In your controller action, you can access the validated payload like this:
111
111
  class MyApiController < ApplicationController
112
112
  # POST /rpc
113
113
  def process
114
- if jsonrpc_batch?
114
+ if jsonrpc_params_batch?
115
115
  # ── batch ───────────────────────────────────────────────────────────────
116
- responses = jsonrpc.filter_map { |req| handle_single_request(req) } # strip nil (notifications)
116
+ responses = jsonrpc_params.filter_map { |req| handle_single_request(req) } # strip nil (notifications)
117
117
 
118
118
  if responses.empty?
119
119
  head :no_content
@@ -123,7 +123,7 @@ class MyApiController < ApplicationController
123
123
  end
124
124
  else
125
125
  # ── single ──────────────────────────────────────────────────────────────
126
- response = handle_single_request(jsonrpc)
126
+ response = handle_single_request(jsonrpc_params)
127
127
 
128
128
  if response # request (has id)
129
129
  render jsonrpc: response.result,
@@ -7,13 +7,13 @@ module JSONRPC_Rails
7
7
  included do
8
8
  # Returns a JSON_RPC::Request / Notification / Response
9
9
  # or an Array of them for batch calls.
10
- def jsonrpc
10
+ def jsonrpc_params
11
11
  request.env[:jsonrpc]
12
12
  end
13
13
 
14
14
  # Convenience boolean
15
- def jsonrpc_batch?
16
- jsonrpc.is_a?(Array)
15
+ def jsonrpc_params_batch?
16
+ jsonrpc_params.is_a?(Array)
17
17
  end
18
18
  end
19
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JSONRPC_Rails
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonrpc-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih