diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/try.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb index 6605771d90..69be6c4abc 100644 --- a/activesupport/lib/active_support/core_ext/object/try.rb +++ b/activesupport/lib/active_support/core_ext/object/try.rb @@ -1,7 +1,7 @@ require 'delegate' module ActiveSupport - module Try #:nodoc: + module Tryable #:nodoc: def try(*a, &b) try!(*a, &b) if a.empty? || respond_to?(a.first) end @@ -20,11 +20,9 @@ module ActiveSupport end end -[Object, Delegator].each do |klass| - klass.include(ActiveSupport::Try) -end - class Object + include ActiveSupport::Tryable + ## # :method: try # @@ -105,6 +103,8 @@ class Object end class Delegator + include ActiveSupport::Tryable + ## # :method: try # |