| Module | Rails::Generator::Options::ClassMethods |
| In: |
railties/lib/rails_generator/options.rb
|
# File railties/lib/rails_generator/options.rb, line 30 def default_options(options = nil) if options write_inheritable_attribute(:default_options, options) else read_inheritable_attribute(:default_options) or write_inheritable_attribute(:default_options, {}) end end
Merge together our class options. In increasing precedence:
default_options (class default options) runtime_options (provided as argument) mandatory_options (class mandatory options)
# File railties/lib/rails_generator/options.rb, line 42 def full_options(runtime_options = {}) default_options.merge(runtime_options).merge(mandatory_options) end
# File railties/lib/rails_generator/options.rb, line 17 def inherited_with_options(sub) inherited_without_options(sub) if respond_to?(:inherited_without_options) sub.extend(Rails::Generator::Options::ClassMethods) end