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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7fe3b9344f41e95376d60f932c029ceeda46823339dce3be82b3f5f344c2263
4
- data.tar.gz: e207aef4a381275f514ac36864a827ed57167ba9b71fb42c979c0c9d5c627525
3
+ metadata.gz: ee9d1cbec147b0821067b19f44ed87f9a775dae5fdbdddb7c0aec6ad1075cd38
4
+ data.tar.gz: ef299e3d6a8a6ff804843ec2b7903429472c1a9dba1c58b4dca11ccbb5d6ea18
5
5
  SHA512:
6
- metadata.gz: d831c97d045cb17eedcbab103fd61265a1b94b4dc2295102a3c3b3e56cd438553cb72ed1e081224c50f99ff1525e24555e490d98cc2c2956c0d0ab9a38ef5d39
7
- data.tar.gz: 5dfea19c86bc99207a966c800f6486815f1f2e00c1b299e6f0b7d0a1befeee4823c949c6268c53cbd972670b46e486741bfcc7b076bac7edfb1819a4274410d2
6
+ metadata.gz: 98f99e913466aadd2bac00430a7f9882a7ef6a17c08e235d3d1f32b07c493b488a75f6c601cc847bb671a96747b94ded17f3d1a6f519c370776cf57deefad5aa
7
+ data.tar.gz: 6c5ac0da38a42f352e9cd78d003ed5d66d7a447bf8ed4daee3dc5625090f8c5c6e63b6a1a5e982ba4065e53367cb8f3971b2fa92ff3d7d74778f98ebd89618ad
@@ -15,6 +15,10 @@ module Reflect
15
15
  SomeInnerClass.new
16
16
  end
17
17
 
18
+ def self.some_method(arg)
19
+ arg
20
+ end
21
+
18
22
  module SomeInnerConstant
19
23
  end
20
24
 
@@ -14,8 +14,14 @@ module Reflect
14
14
  @strict = strict
15
15
  end
16
16
 
17
- def self.call(subject, constant_name, strict: nil)
18
- build(subject, constant_name, strict: strict)
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.1
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-02 00:00:00.000000000 Z
11
+ date: 2018-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench