simple_ams 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/simple_ams/document.rb +3 -4
- data/lib/simple_ams/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 187d317a579cf83a439386c26889aa8d83d8b4fd
|
4
|
+
data.tar.gz: 3b9c96d21261064d84b17469e6c641d6ffdd6de9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 256cddefd11ab9bddfca80542ab66df3273c6b769e3e1214c1bd8c7de08bf57b75c3bdc8ced67423b1904d64c3f5355dccbec1733a693585e2ac27c99b84d467
|
7
|
+
data.tar.gz: 0bb37d2b577647e1dc2b83bc9fe24b370204f8a7cd58a30078e2c13d951f985d1233559d56bd34c0b2f4dfc954c3324684255d79dc74eab16ce88a275785f2ac
|
data/README.md
CHANGED
@@ -59,7 +59,7 @@ class UserSerializer
|
|
59
59
|
link :root, '/api/v1/', rel: :user
|
60
60
|
#link values can be dynamic as well through lambdas
|
61
61
|
#lambdas take arguments the object to be serialized and the instantiated serializer
|
62
|
-
link :posts, ->(obj, s) {
|
62
|
+
link :posts, ->(obj, s) { s.api_v1_user_followers_path(user_id: obj.id) }, rel: :user
|
63
63
|
#if you also need dynamic options, you can return an array from the lambda
|
64
64
|
link :followers, ->(obj, s) { ["/api/v1/users/#{obj.id}/followers/", rel: obj.type] }
|
65
65
|
|
data/lib/simple_ams/document.rb
CHANGED
@@ -122,9 +122,9 @@ class SimpleAMS::Document
|
|
122
122
|
allowed_options: serializer_for(resource).options
|
123
123
|
})
|
124
124
|
else
|
125
|
-
resource_options.with_resource(resource)
|
126
|
-
end
|
127
|
-
|
125
|
+
# resource_options.with_resource(resource)
|
126
|
+
# end
|
127
|
+
# we need to optimize that using tracked properties
|
128
128
|
SimpleAMS::Options.new(resource, {
|
129
129
|
injected_options: resource_options.injected_options.merge({
|
130
130
|
serializer: serializer_for(resource)
|
@@ -132,7 +132,6 @@ class SimpleAMS::Document
|
|
132
132
|
allowed_options: serializer_for(resource).options
|
133
133
|
})
|
134
134
|
end
|
135
|
-
=end
|
136
135
|
end
|
137
136
|
|
138
137
|
def serializer_for(resource)
|
data/lib/simple_ams/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_ams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filippos Vasilakis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|