json_resource 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/json_resource/model.rb +3 -3
- data/lib/json_resource/refinements.rb +13 -1
- data/lib/json_resource/version.rb +1 -1
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f26ed85c08a888e816d5bece3c37bd373c6fb61df4042e80cd0bcb371dbfd23a
|
4
|
+
data.tar.gz: 48bc07b4f66618f635591dc24de3195ca19eb6fb8a2a253b6fe9d32f1de6ac8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c041eb4bf88f877a95f2330ec8d3c066b62621290d3f30a1121216c9eb57d1625282c5d3c0bfc34f23bfe96e345a7cbf43d7f3b5f72c6299a450f6f862983a0c
|
7
|
+
data.tar.gz: dd98b1e2d0e4fd314e848b3b777a31d1c5a33791c4f161e0dc452fdfcb9da0e6d7ed7c5beaf4115598bcdf6b6d12e2669bf6660300c9223b693ad7dafd7f12d7
|
data/CHANGELOG.md
CHANGED
data/lib/json_resource/model.rb
CHANGED
@@ -68,9 +68,9 @@ module JsonResource
|
|
68
68
|
attribute_accessor_method name
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def has_attributes(*args)
|
72
72
|
options = args.extract_options!
|
73
|
-
args.each { |arg|
|
73
|
+
args.each { |arg| attribute arg, options }
|
74
74
|
end
|
75
75
|
|
76
76
|
def has_object(name, options = {})
|
@@ -186,7 +186,7 @@ module JsonResource
|
|
186
186
|
string.camelcase(:upper)
|
187
187
|
when :dasherize
|
188
188
|
string.underscore.dasherize
|
189
|
-
when nil
|
189
|
+
when nil, :underscore
|
190
190
|
string.underscore
|
191
191
|
else
|
192
192
|
string.public_send(inflection)
|
@@ -202,7 +202,19 @@ module JsonResource
|
|
202
202
|
def symbolize_keys
|
203
203
|
transform_keys(&:to_sym)
|
204
204
|
end
|
205
|
-
|
205
|
+
|
206
|
+
end
|
207
|
+
|
208
|
+
refine Array do
|
209
|
+
|
210
|
+
def extract_options!
|
211
|
+
if last.is_a?(Hash) && last.instance_of?(Hash)
|
212
|
+
pop
|
213
|
+
else
|
214
|
+
{}
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
206
218
|
end
|
207
219
|
|
208
220
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Grosser
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -24,7 +24,21 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bigdecimal
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description:
|
28
42
|
email:
|
29
43
|
- mtgrosser@gmx.net
|
30
44
|
executables: []
|
@@ -44,7 +58,7 @@ homepage: https://github.com/mtgrosser/json_resource
|
|
44
58
|
licenses:
|
45
59
|
- MIT
|
46
60
|
metadata: {}
|
47
|
-
post_install_message:
|
61
|
+
post_install_message:
|
48
62
|
rdoc_options: []
|
49
63
|
require_paths:
|
50
64
|
- lib
|
@@ -52,15 +66,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
66
|
requirements:
|
53
67
|
- - ">="
|
54
68
|
- !ruby/object:Gem::Version
|
55
|
-
version: 2.
|
69
|
+
version: 3.2.0
|
56
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
71
|
requirements:
|
58
72
|
- - ">="
|
59
73
|
- !ruby/object:Gem::Version
|
60
74
|
version: '0'
|
61
75
|
requirements: []
|
62
|
-
rubygems_version: 3.
|
63
|
-
signing_key:
|
76
|
+
rubygems_version: 3.5.11
|
77
|
+
signing_key:
|
64
78
|
specification_version: 4
|
65
79
|
summary: Create Ruby objects from JSON data
|
66
80
|
test_files: []
|