grape_serializer 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/list_entity.rb +27 -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: 68dac5c702407cc6dbaad6aff532d6d86e46bd6df855bb5a3d790de47a91d517
|
4
|
+
data.tar.gz: 458b07f2f66c93a218020ddac94fb26b44f4d7f1f4ae114ab89dd8abdc3170d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1500df9f657a4db4275387d2d5b19a5c52510a708bbde8a9f2ee496cb48b494cffe4e4591aea8385a2483653f27469d878657a494f2150aeef95d57028858536
|
7
|
+
data.tar.gz: 9b5ecba1cdd63b0022c20096a92f19ad8ad1ca0e4118989e38793172f9ffdc1cf84540db54dc1fad98a2c18980f6d5050da85cd8297cca70927361386310f2a3
|
data/lib/list_entity.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
class ListEntity < ServiceEntity
|
2
|
+
|
3
|
+
def self.inherited(subclass)
|
4
|
+
expose :total_count
|
5
|
+
expose :current_page
|
6
|
+
expose :total_pages
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def pagination_items
|
12
|
+
object[:items]
|
13
|
+
end
|
14
|
+
|
15
|
+
def total_count
|
16
|
+
pagination_items.total_count
|
17
|
+
end
|
18
|
+
|
19
|
+
def current_page
|
20
|
+
pagination_items.current_page
|
21
|
+
end
|
22
|
+
|
23
|
+
def total_pages
|
24
|
+
pagination_items.total_pages
|
25
|
+
end
|
26
|
+
|
27
|
+
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JiaRou Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape-entity
|
@@ -32,6 +32,7 @@ extra_rdoc_files: []
|
|
32
32
|
files:
|
33
33
|
- lib/grape_response.rb
|
34
34
|
- lib/grape_serializer.rb
|
35
|
+
- lib/list_entity.rb
|
35
36
|
- lib/service_entity.rb
|
36
37
|
homepage: https://github.com/kdan-mobile-software-ltd/grape_serializer
|
37
38
|
licenses:
|