grape_serializer 0.0.2 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grape_response.rb +2 -0
- data/lib/service_entity.rb +8 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c09cc52b2bfefd96aec2f54dac4199444ac6e3611f330119a25b758f51776830
|
4
|
+
data.tar.gz: 31227436c21622e5e7af7bd1512bed9097fa290542e0ff0c4a89c10422a28044
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38a5f2f7618612e6f121c5f7732dcad5e4144b090ca47e7d68b0899fd77713c5e4c26891ad64417434f7fe4f0e25ad0c207b871ae9ab8ebec5ca972eaf533527
|
7
|
+
data.tar.gz: 17d45f79a20b39fb772d60d195a1859189b169034cce94f0b155b916390d7d3dfaccc4bdfe9c4a81ef527e7c93e95a4c583a6b5c19960c6ba1031e282468727c
|
data/lib/grape_response.rb
CHANGED
data/lib/service_entity.rb
CHANGED
@@ -2,6 +2,9 @@ require 'grape-entity'
|
|
2
2
|
|
3
3
|
class ServiceEntity < Grape::Entity
|
4
4
|
|
5
|
+
# expose append info
|
6
|
+
expose :append_info, merge: true, if: :append
|
7
|
+
|
5
8
|
# expose service additional info by default
|
6
9
|
expose :service_info, merge: true, if: :service
|
7
10
|
|
@@ -12,4 +15,9 @@ class ServiceEntity < Grape::Entity
|
|
12
15
|
service_name = service.class.name.underscore
|
13
16
|
send(service_name) rescue nil || send(service_name.split('/').last) rescue {}
|
14
17
|
end
|
18
|
+
|
19
|
+
def append_info
|
20
|
+
options[:append]
|
21
|
+
end
|
22
|
+
|
15
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JiaRou Lee
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape-entity
|
@@ -37,7 +37,7 @@ homepage: https://github.com/kdan-mobile-software-ltd/grape_serializer
|
|
37
37
|
licenses:
|
38
38
|
- MIT
|
39
39
|
metadata: {}
|
40
|
-
post_install_message:
|
40
|
+
post_install_message:
|
41
41
|
rdoc_options: []
|
42
42
|
require_paths:
|
43
43
|
- lib
|
@@ -52,8 +52,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
|
-
rubygems_version: 3.2.
|
56
|
-
signing_key:
|
55
|
+
rubygems_version: 3.2.22
|
56
|
+
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: Serializer for Grape Entity
|
59
59
|
test_files: []
|