aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module
diff options
context:
space:
mode:
authorVasiliy Ermolovich <younash@gmail.com>2011-12-25 20:36:01 +0300
committerVasiliy Ermolovich <younash@gmail.com>2011-12-25 20:36:01 +0300
commit9e0f5ac7fc9a015bd8bd98ed32fa1e1653762196 (patch)
tree46d51bcba8e33403a8ec14b85d0b0ebf4322aaae /activesupport/lib/active_support/core_ext/module
parentbd91154fc47fa7445635014674d784ad4e69d212 (diff)
downloadrails-9e0f5ac7fc9a015bd8bd98ed32fa1e1653762196.tar.gz
rails-9e0f5ac7fc9a015bd8bd98ed32fa1e1653762196.tar.bz2
rails-9e0f5ac7fc9a015bd8bd98ed32fa1e1653762196.zip
Module#name returns nil for anonymous class in ruby 1.9
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module')
-rw-r--r--activesupport/lib/active_support/core_ext/module/anonymous.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/anonymous.rb b/activesupport/lib/active_support/core_ext/module/anonymous.rb
index 3982c9c586..0a9e791030 100644
--- a/activesupport/lib/active_support/core_ext/module/anonymous.rb
+++ b/activesupport/lib/active_support/core_ext/module/anonymous.rb
@@ -1,5 +1,3 @@
-require 'active_support/core_ext/object/blank'
-
class Module
# A module may or may not have a name.
#
@@ -7,7 +5,7 @@ class Module
# M.name # => "M"
#
# m = Module.new
- # m.name # => ""
+ # m.name # => nil
#
# A module gets a name when it is first assigned to a constant. Either
# via the +module+ or +class+ keyword or by an explicit assignment:
@@ -17,8 +15,6 @@ class Module
# m.name # => "M"
#
def anonymous?
- # Uses blank? because the name of an anonymous class is an empty
- # string in 1.8, and nil in 1.9.
- name.blank?
+ name.nil?
end
end