lib/shirinji/resolver.rb in shirinji-0.0.2 vs lib/shirinji/resolver.rb in shirinji-0.0.3
- old
+ new
@@ -22,10 +22,15 @@
resolve_bean(bean).tap do |instance|
singletons[name] = instance if bean.access == :singleton
end
end
+ def reload(map)
+ @map = map
+ reset_cache
+ end
+
def reset_cache
@singletons = {}
end
private
@@ -38,9 +43,10 @@
bean.value.is_a?(Proc) ? bean.value.call : bean.value
end
def resolve_class_bean(bean)
klass, params = resolve_class(bean)
+ return klass unless bean.construct
return klass.new if params.empty?
check_params!(params)
args = params.each_with_object({}) do |(_type, arg), memo|