Sha256: ad8c8bceb58971d7aed05a0e190353713b91bf20eb0047975b7a21eaa26fbd8a
Contents?: true
Size: 774 Bytes
Versions: 26
Compression:
Stored size: 774 Bytes
Contents
require 'scorpion/dependency' module Scorpion class Dependency # {Dependency} for a {Class} contract class ClassDependency < Scorpion::Dependency def fetch( hunt ) resolved = resolve_dependencies( hunt ) hunt.scorpion.spawn hunt, hunt.contract, *hunt.arguments, **resolved, &hunt.block end private def resolve_dependencies( hunt ) dependencies = hunt.dependencies return dependencies unless hunt.contract.respond_to? :initializer_injections hunt.contract.initializer_injections.each_with_object(dependencies.dup) do |attr,deps| next if attr.lazy? deps[attr.name] ||= hunt.fetch_by_traits( attr.contract, attr.traits ) end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems