instance method
parent_name
Ruby on Rails 4.0.13
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
if defined? @parent_name
@parent_name
else
@parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil
end
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