evt-subst_attr 0.2.0.0 → 0.2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c2492920559c438f81ab423c64780cab728da18ac49b6f1ecce7bd0dc217f18
4
- data.tar.gz: bad346b34a2d4793e27b518300327fc4eb041a2a77bc14a65bd84d2981c4c40f
3
+ metadata.gz: 1549a6e124860c9879d509047668d155330489f574552820e802a686f8b4f824
4
+ data.tar.gz: 3e0f3e59d74304fc2ac92bc1e903f88d229bc27316c65a5e3747ee100873ee21
5
5
  SHA512:
6
- metadata.gz: 38090e6794ef9b7b1b9df7e85a0f8a145227b12f480b563ddca9f8acfa0cbea56e5845bd72b7dbee2ff1b934246c3db0a45667658ab5a27ce6d38b5075bdbbd0
7
- data.tar.gz: 7953d7d8adcec6dbb03712ae13038b370cc110d054d6e298abffdfd03082a5590e84f04386fc4c43d64bf14f1748d2413ad04ace86a4cd2b3004413afc3b8e95
6
+ metadata.gz: 978ef310dd087a562701969b68e603b1bd4109191d7161d3100067ca61246fc637707a80029fb4a13b6f7deac9283a613fa8bb46a2a73703a4aa45a90a035b72
7
+ data.tar.gz: 4c41d73476dc9804ef71bc04971599742f61bbfc3feb62fc244a298cb1684caff33f9c7d8f2ac5aa0e181000d4407f8b3c67730a2c4932183b18851894414b50
@@ -18,18 +18,21 @@ module SubstAttr
18
18
  end
19
19
 
20
20
  def specialization(interface)
21
- const_name = :Substitute
22
- unless interface.const_defined?(const_name)
21
+ constant_name = :Substitute
22
+
23
+ reflection = Reflect.(interface, constant_name, strict: false, ancestors: true)
24
+
25
+ if reflection.nil?
23
26
  return nil
24
27
  end
25
28
 
26
- mod = interface.const_get(const_name)
29
+ specialization_module = reflection.constant
27
30
 
28
- unless mod.respond_to?(:build)
31
+ unless specialization_module.respond_to?(:build)
29
32
  return nil
30
33
  end
31
34
 
32
- mod.send(:build)
35
+ specialization_module.send(:build)
33
36
  end
34
37
 
35
38
  module NullObject
data/lib/subst_attr.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'naught'
2
2
 
3
3
  require 'attribute'
4
+ require 'reflect'
4
5
 
5
6
  require 'subst_attr/substitute'
6
7
  require 'subst_attr/attribute'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-subst_attr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.0
4
+ version: 0.2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-attribute
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: evt-reflect
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: naught
29
43
  requirement: !ruby/object:Gem::Requirement