evt-reflect 0.1.0.0 → 0.1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/reflect/reflection.rb +7 -3
- 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: 2cb7354176aa20ae6ac1b80dac6373d786aaf3e38934093fdbc732f844af0e8e
|
4
|
+
data.tar.gz: 6fec96989b2f5d08ba6115c4db77379aec0b019d77f53d4c9e0296de90a4d872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c31835237d4b0d55ba9ef9bc2fb102dad19990814e94ed8ea0b4f38865e75a8850137120389bc376ab029a537172fce4b003a175ffd686a68c087fc6f5da167e
|
7
|
+
data.tar.gz: cb26d37deea43d8761f81beb5ac5a8e088f59a978d8d68de17a3023f7f7d1458e309ca14f15e2b4484921e346ca302326e922890558503937e0e4e9c49145dc3
|
data/lib/reflect/reflection.rb
CHANGED
@@ -39,15 +39,19 @@ module Reflect
|
|
39
39
|
constant.respond_to?(name)
|
40
40
|
end
|
41
41
|
|
42
|
-
def get(accessor_name)
|
43
|
-
|
42
|
+
def get(accessor_name, strict: nil)
|
43
|
+
strict = self.strict if strict.nil?
|
44
|
+
|
45
|
+
result = get_constant(accessor_name, strict: strict)
|
44
46
|
return nil if result.nil?
|
45
47
|
|
46
48
|
constant = Reflect.subject_constant(result)
|
47
49
|
self.class.new(subject, constant, strict)
|
48
50
|
end
|
49
51
|
|
50
|
-
def get_constant(accessor_name)
|
52
|
+
def get_constant(accessor_name, strict: nil)
|
53
|
+
strict = self.strict if strict.nil?
|
54
|
+
|
51
55
|
if !constant_accessor?(accessor_name)
|
52
56
|
if strict
|
53
57
|
raise Reflect::Error, "Constant #{constant.name} does not have accessor #{accessor_name}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-reflect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1.0
|
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-
|
11
|
+
date: 2018-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test_bench
|