instance method
parent_name
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v6.0.6Signature
parent_name()
Returns the name of the module containing this one.
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 Module