structure 0.28.3 → 0.28.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/structure.rb +12 -2
- 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: d77e0416536e453a05108b31134fd24008e49f0e
|
4
|
+
data.tar.gz: e2122d7456a18be5adbef05cf999cc0b435f1e7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5ced1b086d058b3959b87c4be06e0b3e71634c91beb10806bacb14d02ff956a532b0d1c42bb5915d601ac8b1865c6b0d7be6184a0d8491f02b8ef4ac52de56e
|
7
|
+
data.tar.gz: 8085732ad84ef408c32eda27c35e4cadd25a11aaf919593cb93b26508ef91cb2efcf3f57ff1c22088b48735b89b715965644c22d53e3e88cec5c7ab001dab8fe
|
data/structure.rb
CHANGED
@@ -4,8 +4,18 @@ module Structure
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def attributes
|
7
|
-
attribute_names.reduce({}) { |ret,
|
8
|
-
|
7
|
+
attribute_names.reduce({}) { |ret, key|
|
8
|
+
val = self.send(key)
|
9
|
+
|
10
|
+
ret.update(key =>
|
11
|
+
if val.respond_to?(:attributes)
|
12
|
+
val.attributes
|
13
|
+
elsif val.is_a?(Array)
|
14
|
+
val.map { |el| el.respond_to?(:attributes) ? el.attributes : el }
|
15
|
+
else
|
16
|
+
val
|
17
|
+
end
|
18
|
+
)
|
9
19
|
}
|
10
20
|
end
|
11
21
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: structure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.28.
|
4
|
+
version: 0.28.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: me@hakanensari.com
|