class method
self.default_for_option
Ruby on Rails 7.2.3
Since v3.0.20Signature
self.default_for_option(config, name, options, default)
Returns default for the option name given doing a lookup in config.
Parameters
-
configreq -
namereq -
optionsreq -
defaultreq
Source
# File railties/lib/rails/generators/base.rb, line 362
def self.default_for_option(config, name, options, default) # :doc:
if generator_name && (c = config[generator_name.to_sym]) && c.key?(name)
c[name]
elsif base_name && (c = config[base_name.to_sym]) && c.key?(name)
c[name]
elsif config[:rails].key?(name)
config[:rails][name]
else
default
end
end
Defined in railties/lib/rails/generators/base.rb line 362
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Base