nested 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nested.rb +13 -1
- data/nested.gemspec +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: 1a7ac105733a5c7bab517c0414c54f7483d1c0d8
|
4
|
+
data.tar.gz: c4d0bb6b2bfb8d18eee1a2257b4fb960b4dc7833
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd3a6acb935adc5433038f07a72a5b50bb45ad9ca699ed2355762ab2dbba74c36ee78681bcfa5cb699c41c1af84e243b8f51860a9f52b6df8e4c2cbdee300676
|
7
|
+
data.tar.gz: 7a95f0db8cfa7931a7a0b214e9f35ccf275fb781660be0fd0d6276f32cbf3a82958bac8f81c9949a18e6a7f3fcbf7a586309e0f0bae55afa47dbe07a714e45c4
|
data/lib/nested.rb
CHANGED
@@ -65,7 +65,7 @@ module Nested
|
|
65
65
|
|
66
66
|
serialize *__serialize_args, &__serialize_block
|
67
67
|
else
|
68
|
-
serialize &->(obj) {
|
68
|
+
serialize &->(obj) { raise "implement serializer for #{@__resource.type} #{@__resource.name}" }
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -81,6 +81,18 @@ module Nested
|
|
81
81
|
@collection == true
|
82
82
|
end
|
83
83
|
|
84
|
+
def type
|
85
|
+
if singleton?
|
86
|
+
:singleton
|
87
|
+
elsif member?
|
88
|
+
:member
|
89
|
+
elsif collection?
|
90
|
+
:collection
|
91
|
+
else
|
92
|
+
raise "undefined"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
84
96
|
def serialize(*args, &block)
|
85
97
|
raise "pass either *args or &block" if args.empty? && !block && !member?
|
86
98
|
|
data/nested.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nested
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Zimmek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|