Class: Jeeves::ResolveDependency

Inherits:
Object
  • Object
show all
Defined in:
lib/jeeves/resolve_dependency.rb

Constant Summary collapse

RESOLVERS =
[ResolveMethod, ResolveCallable, ResolveConstant]

Class Method Summary collapse

Class Method Details

.call(scope, name) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/jeeves/resolve_dependency.rb', line 8

def self.call(scope, name)
  delegator = nil
  RESOLVERS.each do |resolver|
    break if delegator = resolver.call(scope, name)
  end
  delegator = mock(delegator, scope, name) if Jeeves.in_test_framework?
  delegator or unresolved(scope, name)
end