material 0.2.6 → 0.2.7
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/for.rb +9 -3
- data/lib/material/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2bfa3f32901451e69e88fa370ef2ff8f3add861df3551864683badfd59452cc
|
4
|
+
data.tar.gz: ce590b13773298904f7bf0d014c6f3ce0d030a391b6f36c75219e16a2ea1aa9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d755826933146b93891da1dd1a839bae456438100db94d8d81b2078ed9a11c1646a684d40181e21d5d395bedebdae2225ba364799c642f25cefc1a05e405056
|
7
|
+
data.tar.gz: b224702ae9b686495526de08e38ff13e3516e64dd34fcaa4652ec3d9eb690151b4bc0a45d2bb5842f75f1ce4c20e0824bdd43d6de87886094e573df60d70a6ad
|
@@ -5,11 +5,17 @@ module Material
|
|
5
5
|
module For
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
|
-
LOOKUP_NAME = :material_class
|
9
|
-
|
10
8
|
class_methods do
|
11
9
|
def material_class_for(object, subtype)
|
12
|
-
|
10
|
+
method = "#{subtype.downcase}_class".to_sym
|
11
|
+
object_class = object.is_a?(Class) ? object : object.class
|
12
|
+
lookup(object, method) || lookup(object_class, method) || "#{object_class.name}#{subtype}".safe_constantize
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def lookup(object, lookup_name)
|
18
|
+
object.public_send(lookup_name) if object.respond_to?(lookup_name)
|
13
19
|
end
|
14
20
|
end
|
15
21
|
end
|
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.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Garside
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.16.2
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '1.0'
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.16.2
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.0'
|
@@ -148,7 +148,7 @@ dependencies:
|
|
148
148
|
requirements:
|
149
149
|
- - ">="
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: 0.
|
151
|
+
version: 0.16.2
|
152
152
|
- - "<"
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '1.0'
|
@@ -158,7 +158,7 @@ dependencies:
|
|
158
158
|
requirements:
|
159
159
|
- - ">="
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version: 0.
|
161
|
+
version: 0.16.2
|
162
162
|
- - "<"
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '1.0'
|
@@ -168,7 +168,7 @@ dependencies:
|
|
168
168
|
requirements:
|
169
169
|
- - ">="
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version: 0.
|
171
|
+
version: 0.16.2
|
172
172
|
- - "<"
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '1.0'
|
@@ -178,7 +178,7 @@ dependencies:
|
|
178
178
|
requirements:
|
179
179
|
- - ">="
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: 0.
|
181
|
+
version: 0.16.2
|
182
182
|
- - "<"
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '1.0'
|