instance method
extract_last_module
Ruby on Rails 6.0.6
Since v4.1.16 PrivateSignature
extract_last_module(nesting)
Takes in an array of nested modules and extracts the last module
Parameters
-
nestingreq
Source
# File railties/lib/rails/generators/base.rb, line 276
def extract_last_module(nesting) # :doc:
nesting.inject(Object) do |last_module, nest|
break unless last_module.const_defined?(nest, false)
last_module.const_get(nest)
end
end
Defined in railties/lib/rails/generators/base.rb line 276
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Base