material 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/material/concerns/attributes.rb +9 -5
- data/lib/material/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: 63ebb20e8ed5a0d33f0ade5fb366b7fbd8d71e071b2f02bcac3c75818d4eeb3f
|
4
|
+
data.tar.gz: 3f916b0ab6325d85f49060ae786931cccdd2e5d8708add24ee6016a9f106b6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f4ab1195b1981c32be7d1c0972a150464a9ae30999d8d0fe9542deb24d576f85d647b8eaa04ecb48b93f448ca76731c4232c8be51278f39394ee9962b796a1b
|
7
|
+
data.tar.gz: 0dd76d3b7949042f30c5ee2eecf49154d86ad3e5cb8b4989cc8e98c85229a52f87d68ab4503a26ce4ae6d448ec1e559c262a8a8fe9f00d0e1b10bf669e20b008
|
@@ -28,12 +28,16 @@ module Material
|
|
28
28
|
formatted_attributes.fetch(attribute)
|
29
29
|
end
|
30
30
|
|
31
|
+
def display_attributes
|
32
|
+
attribute_names
|
33
|
+
end
|
34
|
+
|
31
35
|
def attribute_values
|
32
|
-
|
36
|
+
display_attributes.each_with_object({}) { |attribute, hash| hash[attribute] = public_send(attribute.to_sym) }
|
33
37
|
end
|
34
38
|
|
35
39
|
def attribute_types
|
36
|
-
|
40
|
+
display_attributes.each_with_object({}) { |attribute, hash| hash[attribute] = type_for_attribute(attribute).type }
|
37
41
|
end
|
38
42
|
|
39
43
|
def formatted_attributes
|
@@ -44,9 +48,9 @@ module Material
|
|
44
48
|
|
45
49
|
def sorted_attribute_names
|
46
50
|
[
|
47
|
-
(head_attributes &
|
48
|
-
(
|
49
|
-
(tail_attributes &
|
51
|
+
(head_attributes & display_attributes),
|
52
|
+
(display_attributes - head_attributes - tail_attributes).sort,
|
53
|
+
(tail_attributes & display_attributes),
|
50
54
|
].flatten
|
51
55
|
end
|
52
56
|
|
data/lib/material/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: material
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Garside
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|