diff options
author | Toshimaru <me@toshimaru.net> | 2016-12-09 04:55:21 +0900 |
---|---|---|
committer | Toshimaru <me@toshimaru.net> | 2016-12-09 05:21:11 +0900 |
commit | d9ff835b99ff3c7567ccde9b1379b4deeabee32f (patch) | |
tree | 93b9258440a74ddb9f0978f5b42d8850de28fdfe /activesupport/lib | |
parent | 7407d35c5417b6ef872663936a5880ede8ab711c (diff) | |
download | rails-d9ff835b99ff3c7567ccde9b1379b4deeabee32f.tar.gz rails-d9ff835b99ff3c7567ccde9b1379b4deeabee32f.tar.bz2 rails-d9ff835b99ff3c7567ccde9b1379b4deeabee32f.zip |
split DELEGATION_RESERVED_METHOD_NAMES in half
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index f5f4ba61b7..19f692e943 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -6,11 +6,12 @@ class Module # option is not used. class DelegationError < NoMethodError; end + RUBY_RESERVED_KEYWORDS = %w(alias and BEGIN begin break case class def defined? do + else elsif END end ensure false for if in module next nil not or redo rescue retry + return self super then true undef unless until when while yield) + DELEGATION_RESERVED_KEYWORDS = %w(_ arg args block) DELEGATION_RESERVED_METHOD_NAMES = Set.new( - %w(_ arg args alias and BEGIN begin block break case class def defined? do - else elsif END end ensure false for if in module next nil not or redo - rescue retry return self super then true undef unless until when while - yield) + RUBY_RESERVED_KEYWORDS + DELEGATION_RESERVED_KEYWORDS ).freeze # Provides a +delegate+ class method to easily expose contained objects' |