Class: Goldiloader::AutoIncludeContext
- Inherits:
-
Struct
- Object
- Struct
- Goldiloader::AutoIncludeContext
- Defined in:
- lib/goldiloader/auto_include_context.rb
Instance Attribute Summary collapse
-
#association_path ⇒ Object
Returns the value of attribute association_path.
-
#model_registry ⇒ Object
Returns the value of attribute model_registry.
Class Method Summary collapse
Instance Method Summary collapse
- #register_models(models) ⇒ Object (also: #register_model)
Instance Attribute Details
#association_path ⇒ Object
Returns the value of attribute association_path
4 5 6 |
# File 'lib/goldiloader/auto_include_context.rb', line 4 def association_path @association_path end |
#model_registry ⇒ Object
Returns the value of attribute model_registry
4 5 6 |
# File 'lib/goldiloader/auto_include_context.rb', line 4 def model_registry @model_registry end |
Class Method Details
.create_empty ⇒ Object
5 6 7 |
# File 'lib/goldiloader/auto_include_context.rb', line 5 def self.create_empty Goldiloader::AutoIncludeContext.new(Goldiloader::ModelRegistry.new, []) end |
Instance Method Details
#register_models(models) ⇒ Object Also known as: register_model
9 10 11 12 13 14 15 |
# File 'lib/goldiloader/auto_include_context.rb', line 9 def register_models(models) Array.wrap(models).each do |model| model.auto_include_context = self model_registry.register(model, association_path) end self end |