Class: Hypo::Lifetime::Transient
- Inherits:
-
Object
- Object
- Hypo::Lifetime::Transient
- Defined in:
- lib/hypo/lifetime/transient.rb
Instance Method Summary collapse
Instance Method Details
#instance(component, attrs = nil) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/hypo/lifetime/transient.rb', line 4 def instance(component, attrs = nil) if component.respond_to? :type dependencies = attrs ? [attrs].concat(component.dependencies) : component.dependencies component.type.new(*dependencies) else component.object end end |