simple_endpoint 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -3
- data/lib/simple_endpoint/version.rb +1 -1
- data/lib/simple_endpoint.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55a2646d762faef9f9bd692892c9dc29837d1fb1a6683d776c4822a155ea15bc
|
4
|
+
data.tar.gz: 4e05da905deeed9b872a3ad816a09c0d94a3f619506342ef64f1995f24c8cfbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a670e1db13967ebd1d89b6abc870cb206b63ed9688f8625b067e8300b6f4c84cbfb9bc67e6767d6e37a253abd64e1ee1d053302d3e6b4d20ff8895393bd66f7
|
7
|
+
data.tar.gz: 284851163ebf6ccf7168aa9787408721cbdf5a7d2a7b8a2fb712f357cc6c1d6d9843fbe1ab33d592942b689e247a99646f597a316e93c4191141390e48de7cf6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,8 +6,7 @@ Dry-matcher free implementation of trailblazer endpoint.
|
|
6
6
|
Add this to your Gemfile:
|
7
7
|
|
8
8
|
```ruby
|
9
|
-
gem 'simple_endpoint'
|
10
|
-
gem 'simple_endpoint', github: 'differencialx/simple_endpoint', :branch => 'master'
|
9
|
+
gem 'simple_endpoint'
|
11
10
|
```
|
12
11
|
|
13
12
|
## Getting Started
|
@@ -47,7 +46,7 @@ class ApplicationController < ActionController::Base
|
|
47
46
|
|
48
47
|
def default_handler
|
49
48
|
{
|
50
|
-
success: -> (result) { render json: result['model'], **result['render_options'] status: 200 },
|
49
|
+
success: -> (result) { render json: result['model'], **result['render_options'], status: 200 },
|
51
50
|
invalid: -> (result) { render json: result['contract.default'].errors, serializer: ErrorSerializer, status: :unprocessable_entity }
|
52
51
|
}
|
53
52
|
end
|
data/lib/simple_endpoint.rb
CHANGED
@@ -4,10 +4,10 @@ require 'simple_endpoint/version'
|
|
4
4
|
|
5
5
|
module SimpleEndpoint
|
6
6
|
module Controller
|
7
|
-
def endpoint(operation:, different_cases: {},
|
7
|
+
def endpoint(operation:, different_cases: {}, different_handler: {}, options: {}, before_response: {})
|
8
8
|
Endpoint.call(
|
9
9
|
operation,
|
10
|
-
default_handler.merge(
|
10
|
+
default_handler.merge(different_handler),
|
11
11
|
default_cases.merge(different_cases),
|
12
12
|
before_response,
|
13
13
|
endpoint_options.merge(options)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_endpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Bal
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|