sink-base 0.2.1 → 0.2.2
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 +4 -4
- data/lib/sink/base/version.rb +1 -1
- data/lib/sink/base/view/json_render.rb +29 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ab98031fd707921a81ce9b01cf710a99a52a768c541b115741334473595e269
|
4
|
+
data.tar.gz: 63dc96d4a2f001147b63e42da6d6048ffc47a6b34ac68d5ea5d20799eeff9501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24f8830efb40200433e57f439352c6f57d533d58c61f59f5d4901fde04814631ed49f55179ddd12aecd1be176deec8606ef4b8e924b77175743006e8e3387860
|
7
|
+
data.tar.gz: 29f43f0dc7edfc84a4b48f980e237c2c3951341b1e1ca88e1eb38f4297d35211699b5f5623da9ce738e740cae7f8e185254d1a6d7cfaffdfaa9a199049c99222
|
data/lib/sink/base/version.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
module Sink
|
2
|
+
module Base
|
3
|
+
module View
|
4
|
+
class JsonRender
|
5
|
+
def bad_request(message)
|
6
|
+
render(400, message)
|
7
|
+
end
|
8
|
+
|
9
|
+
def not_found(message)
|
10
|
+
render(404, message)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def render(status_code, message)
|
16
|
+
{
|
17
|
+
statusCode: status_code,
|
18
|
+
headers: {
|
19
|
+
'Content-Type' => 'application/json'
|
20
|
+
},
|
21
|
+
body: {
|
22
|
+
message: message,
|
23
|
+
}.to_json
|
24
|
+
}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sink-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xu Yunlong
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-dynamodb
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- lib/sink/base.rb
|
44
44
|
- lib/sink/base/dao/qa_dao.rb
|
45
45
|
- lib/sink/base/version.rb
|
46
|
+
- lib/sink/base/view/json_render.rb
|
46
47
|
- sink-base.gemspec
|
47
48
|
homepage: https://github.com/talexu/sink-base
|
48
49
|
licenses: []
|