instance method
parent_name
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
parent_name()
Returns the name of the module containing this one.
p M::N.parent_name # => "M"
Source
# File activesupport/lib/active_support/core_ext/module/introspection.rb, line 7
def parent_name
unless defined? @parent_name
@parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil
end
@parent_name
end
Defined in activesupport/lib/active_support/core_ext/module/introspection.rb line 7
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::CoreExtensions::Module