diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-04-22 18:29:05 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-04-22 23:11:15 +0900 |
commit | ca9ac310028d0009edf1fbf657541d2dea327535 (patch) | |
tree | 83fd7c9fcbe6410ca670ae15439e85fe8c95188e /activesupport/lib | |
parent | 0541a0d5481043a9c78371446389794944daf3f0 (diff) | |
download | rails-ca9ac310028d0009edf1fbf657541d2dea327535.tar.gz rails-ca9ac310028d0009edf1fbf657541d2dea327535.tar.bz2 rails-ca9ac310028d0009edf1fbf657541d2dea327535.zip |
`respond_to_missing?` should be private
Follow up of 03d3f036.
Some of `respond_to?` were replaced to `respond_to_missing?` in 03d3f036.
But the visibility is still public. It should be private.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/duration.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb index 99080e34a1..d4424ed792 100644 --- a/activesupport/lib/active_support/duration.rb +++ b/activesupport/lib/active_support/duration.rb @@ -305,10 +305,6 @@ module ActiveSupport to_i end - def respond_to_missing?(method, include_private = false) #:nodoc: - @value.respond_to?(method, include_private) - end - # Build ISO 8601 Duration string for this duration. # The +precision+ parameter can be used to limit seconds' precision of duration. def iso8601(precision: nil) @@ -335,8 +331,12 @@ module ActiveSupport end end + def respond_to_missing?(method, _) + value.respond_to?(method) + end + def method_missing(method, *args, &block) - value.send(method, *args, &block) + value.public_send(method, *args, &block) end def raise_type_error(other) |