evt-reflect 0.0.0.1 → 0.1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reflect/controls/subject.rb +4 -0
- data/lib/reflect/reflection.rb +8 -2
- 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: ee9d1cbec147b0821067b19f44ed87f9a775dae5fdbdddb7c0aec6ad1075cd38
|
4
|
+
data.tar.gz: ef299e3d6a8a6ff804843ec2b7903429472c1a9dba1c58b4dca11ccbb5d6ea18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98f99e913466aadd2bac00430a7f9882a7ef6a17c08e235d3d1f32b07c493b488a75f6c601cc847bb671a96747b94ded17f3d1a6f519c370776cf57deefad5aa
|
7
|
+
data.tar.gz: 6c5ac0da38a42f352e9cd78d003ed5d66d7a447bf8ed4daee3dc5625090f8c5c6e63b6a1a5e982ba4065e53367cb8f3971b2fa92ff3d7d74778f98ebd89618ad
|
data/lib/reflect/reflection.rb
CHANGED
@@ -14,8 +14,14 @@ module Reflect
|
|
14
14
|
@strict = strict
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
|
17
|
+
def call(method_name, arg=nil)
|
18
|
+
unless constant.respond_to?(method_name)
|
19
|
+
raise Reflect::Error, "Constant #{constant.name} does not define method #{method_name}"
|
20
|
+
end
|
21
|
+
|
22
|
+
arg ||= subject
|
23
|
+
|
24
|
+
constant.send(method_name, arg)
|
19
25
|
end
|
20
26
|
|
21
27
|
def self.build(subject, constant_name, strict: nil)
|
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.0.0
|
4
|
+
version: 0.1.0.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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test_bench
|