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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d67d499162c36a14396e908ac1ffe6835b001d6c
4
- data.tar.gz: 67605fbb508be908833988854cee950c37715e1e
3
+ metadata.gz: 4003ab3ee51fcd4973bbf6766b5a8aff6505ce8d
4
+ data.tar.gz: 22ca0e3e65ebe890bcafdeaa5aa2c1484370cb14
5
5
  SHA512:
6
- metadata.gz: ba2ec6b4c412c521a433db64029fc5b309153024cc35b4aa03aa521b054c7cc48cef3ef3e790d480af869e71a5cddd7653a050eaca281ac3e185a8d01cba7355
7
- data.tar.gz: f48f8e1691cfc523c744f807dcb020429e304861c8b3dded09925ff99a2272ea78208c38849870764d2bc86812530220ae5842ce40c0ff3cfe45c4035c0391e7
6
+ metadata.gz: b9a6c8903baf7d83cdf0d46211241a38dd16643690baf27371bcc62a72fea11d3852c28ab3b642d893416603d805267e41ff06824c3b1f3d7dd8c75828606bcf
7
+ data.tar.gz: b44775573ba4c9e40d2f6080926c183a2398439d95a25dda82d57c492f7b0e12870c6bc97f306bc47f88020e81f30f4abf30645465d06d7445504265d570d44d
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  class MethodObject
3
- VERSION = '2.1.1'
3
+ VERSION = '2.1.2'
4
4
  end
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(attribute, send(attribute), method_name)
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
- send(attribute),
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
- def call
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.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-14 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler