swagger-serializer 0.3.0 → 0.4.0
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/swagger/serializer/store.rb +2 -8
- data/lib/swagger/serializer/version.rb +1 -1
- 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: 9117f21413014f63963039d2bc4b9bd5af69822848e7171ab138db2f577e426f
|
4
|
+
data.tar.gz: 9f8b7698fb58f7519642ca076962928ec7fbc6503307432e0f42a97900a20738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cf2998a61d2755e0ac01ece1cf2d03e63e52013eb82add89a2fdc85d0249754ca8054dfb2edaf54bbb90bb9c5ef07280cabb1d0c946f749551a2e628cc7a330
|
7
|
+
data.tar.gz: e46a73c62aa9e9d4217943df68d943b3370dd14da3b6c0db13b4897c7931177bc5379b1d4fed0ee9a653e1a10e51af46cf2cc17b35f579a97ef35bed9d1fcc64
|
data/README.md
CHANGED
@@ -131,7 +131,7 @@ Now you can get `{ "id" => 42, "name" => "me!!!!" }`.
|
|
131
131
|
|
132
132
|
This serializer class detection uses the schema's `title` key.
|
133
133
|
If you want to use `Foo::BarSerializer`, set `Foo::Bar` to `title` key.
|
134
|
-
The key is configurable by `Swagger::Serializer::Store.current[:inject_key] = "my_inject_key"`.
|
134
|
+
The key is configurable by `Swagger::Serializer::Store.current.options[:inject_key] = "my_inject_key"`.
|
135
135
|
|
136
136
|
Sometimes model needs direct serialize.
|
137
137
|
|
@@ -7,20 +7,14 @@ module Swagger
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
+
attr_reader :options
|
11
|
+
|
10
12
|
def initialize(options = nil)
|
11
13
|
@options = options || {}
|
12
14
|
@options[:inject_key] ||= "title"
|
13
15
|
@options[:injectors] ||= Injectors.new(cache: @options[:cache])
|
14
16
|
end
|
15
17
|
|
16
|
-
def [](name)
|
17
|
-
@options[name]
|
18
|
-
end
|
19
|
-
|
20
|
-
def []=(name, value)
|
21
|
-
@options[name] = value
|
22
|
-
end
|
23
|
-
|
24
18
|
def serializer_options
|
25
19
|
@options
|
26
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger-serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Narazaka
|
@@ -234,7 +234,7 @@ metadata:
|
|
234
234
|
homepage_uri: https://github.com/Narazaka/swagger-serializer
|
235
235
|
source_code_uri: https://github.com/Narazaka/swagger-serializer.git
|
236
236
|
changelog_uri: https://github.com/Narazaka/swagger-serializer/blob/master/CHANGELOG.md
|
237
|
-
documentation_uri: https://www.rubydoc.info/gems/swagger-serializer/0.
|
237
|
+
documentation_uri: https://www.rubydoc.info/gems/swagger-serializer/0.4.0
|
238
238
|
post_install_message:
|
239
239
|
rdoc_options: []
|
240
240
|
require_paths:
|