method_man 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/method_object/version.rb +1 -1
- data/lib/method_object.rb +8 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4003ab3ee51fcd4973bbf6766b5a8aff6505ce8d
|
4
|
+
data.tar.gz: 22ca0e3e65ebe890bcafdeaa5aa2c1484370cb14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9a6c8903baf7d83cdf0d46211241a38dd16643690baf27371bcc62a72fea11d3852c28ab3b642d893416603d805267e41ff06824c3b1f3d7dd8c75828606bcf
|
7
|
+
data.tar.gz: b44775573ba4c9e40d2f6080926c183a2398439d95a25dda82d57c492f7b0e12870c6bc97f306bc47f88020e81f30f4abf30645465d06d7445504265d570d44d
|
data/lib/method_object.rb
CHANGED
@@ -45,12 +45,16 @@ class MethodObject
|
|
45
45
|
def candidates_for_method_missing(method_name)
|
46
46
|
potential_candidates =
|
47
47
|
self.class.attributes.map do |attribute|
|
48
|
-
PotentialDelegator.new(
|
48
|
+
PotentialDelegator.new(
|
49
|
+
attribute,
|
50
|
+
public_send(attribute),
|
51
|
+
method_name,
|
52
|
+
)
|
49
53
|
end +
|
50
54
|
self.class.attributes.map do |attribute|
|
51
55
|
PotentialDelegatorWithPrefix.new(
|
52
56
|
attribute,
|
53
|
-
|
57
|
+
public_send(attribute),
|
54
58
|
method_name,
|
55
59
|
)
|
56
60
|
end
|
@@ -87,11 +91,7 @@ class MethodObject
|
|
87
91
|
object.respond_to?(delegated_method)
|
88
92
|
end
|
89
93
|
|
90
|
-
|
91
|
-
object.public_send(delegated_method)
|
92
|
-
end
|
93
|
-
|
94
|
-
alias_method :method_to_call_on_delegate, :delegated_method
|
94
|
+
alias_method(:method_to_call_on_delegate, :delegated_method)
|
95
95
|
end
|
96
96
|
|
97
97
|
# Represents a possible match of the form:
|
@@ -102,10 +102,6 @@ class MethodObject
|
|
102
102
|
name_matches? && object.respond_to?(method_to_call_on_delegate)
|
103
103
|
end
|
104
104
|
|
105
|
-
def call
|
106
|
-
object.public_send(method_to_call_on_delegate)
|
107
|
-
end
|
108
|
-
|
109
105
|
def method_to_call_on_delegate
|
110
106
|
delegated_method.to_s.sub(prefix, '')
|
111
107
|
end
|
@@ -160,7 +156,7 @@ class MethodObject
|
|
160
156
|
end
|
161
157
|
|
162
158
|
def required_keyword_args_string
|
163
|
-
attributes.map { |arg| "#{arg}:" }.join(',')
|
159
|
+
attributes.map { |arg| "#{arg}:" }.join(', ')
|
164
160
|
end
|
165
161
|
|
166
162
|
def assignments
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: method_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clay Shentrup
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|