structure 0.28.5 → 0.28.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/structure.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bf9143686b35d2943e1f00ebd5d6d8ebd125f68
|
4
|
+
data.tar.gz: af989c46bf1020bda14a60d37c2a177198b8096a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e64253dab58e9f86054cc1306ff65b8062c73aaae8cd6ffced3e9d0fed3c24ffff250bb7cfacb9671d774726856e4049fb8d769a42bcc6da37d3dd9f96c437c
|
7
|
+
data.tar.gz: 9b60d37cc9bf25968abcd3b22257d5b8c1297c2f4c8935db7c145c21a04c6d7844350b901c73c9c90bed43c9c12915ef77c123fc2c81dc887ecf806be0cf3c7b
|
data/structure.rb
CHANGED
@@ -5,7 +5,7 @@ module Structure
|
|
5
5
|
|
6
6
|
def attributes
|
7
7
|
attribute_names.reduce({}) { |ret, key|
|
8
|
-
val =
|
8
|
+
val = send(key)
|
9
9
|
|
10
10
|
ret.update(key =>
|
11
11
|
if val.respond_to?(:attributes)
|
@@ -32,8 +32,9 @@ module Structure
|
|
32
32
|
class_name = self.class.name || self.class.to_s.gsub(/[^\w:]/, '')
|
33
33
|
|
34
34
|
"#<#{class_name} #{
|
35
|
-
|
36
|
-
.map { |key
|
35
|
+
attribute_names
|
36
|
+
.map { |key|
|
37
|
+
val = send(key)
|
37
38
|
if val.is_a?(Array)
|
38
39
|
"#{key}=[#{val.take(3).map(&:inspect).join(', ')}" + (val.size > 3 ? '...' : '') + ']'
|
39
40
|
else
|