Class: Rails::Autoloaders
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Inherits: | Object |
Defined in: | railties/lib/rails/autoloaders.rb, railties/lib/rails/autoloaders/inflector.rb |
Class Method Summary
- .new ⇒ Autoloaders constructor
Instance Attribute Summary
- #logger=(logger) writeonly
- #main readonly
- #once readonly
- #zeitwerk_enabled? ⇒ Boolean readonly
::Enumerable
- Included
#many? | Returns |
Instance Method Summary
::Enumerable
- Included
#compact_blank | Returns a new |
#exclude? | The negative of the |
#excluding | Returns a copy of the enumerable excluding the specified elements. |
#in_order_of | Returns a new |
#including | Returns a new array that includes the passed elements. |
#index_by | Convert an enumerable to a hash, using the block result as the key and the element as the value. |
#index_with | Convert an enumerable to a hash, using the element as the key and the block result as the value. |
#maximum | Calculates the maximum from the extracted elements. |
#minimum | Calculates the minimum from the extracted elements. |
#pick | Extract the given key from the first element in the enumerable. |
#pluck | Extract the given key from each element in the enumerable. |
#sole | Returns the sole item in the enumerable. |
#without | Alias for Enumerable#excluding. |
#as_json |
::ActiveSupport::EnumerableCoreExt::Constants
- Included
Constructor Details
.new ⇒ Autoloaders
# File 'railties/lib/rails/autoloaders.rb', line 11
def initialize # This `require` delays loading the library on purpose. # # In Rails 7.0.0, railties/lib/rails.rb loaded Zeitwerk as a side-effect, # but a couple of edge cases related to Bundler and Bootsnap showed up. # They had to do with order of decoration of `Kernel#require`, something # the three of them do. # # Delaying this `require` up to this point is a convenient trade-off. require "zeitwerk" @main = Zeitwerk::Loader.new @main.tag = "rails.main" @main.inflector = Inflector @once = Zeitwerk::Loader.new @once.tag = "rails.once" @once.inflector = Inflector end
Instance Attribute Details
#logger=(logger) (writeonly)
[ GitHub ]#main (readonly)
[ GitHub ]# File 'railties/lib/rails/autoloaders.rb', line 9
attr_reader :main, :once
#once (readonly)
[ GitHub ]# File 'railties/lib/rails/autoloaders.rb', line 9
attr_reader :main, :once
#zeitwerk_enabled? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'railties/lib/rails/autoloaders.rb', line 44
def zeitwerk_enabled? true end
Instance Method Details
#each {|main| ... }
#log!
[ GitHub ]# File 'railties/lib/rails/autoloaders.rb', line 40
def log! each(&:log!) end