Module: IOPromise::DataLoader
- Included in:
- ViewComponent::DataLoader
- Defined in:
- lib/iopromise/data_loader.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
26 27 28 |
# File 'lib/iopromise/data_loader.rb', line 26 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#async_attributes ⇒ Object
30 31 32 |
# File 'lib/iopromise/data_loader.rb', line 30 def async_attributes @async_attributes ||= Promise.all(attr_async_promises) end |
#sync ⇒ Object
34 35 36 37 |
# File 'lib/iopromise/data_loader.rb', line 34 def sync async_attributes.sync self end |