Module: CompletionKit::Checks::ExpectedResolver

Defined in:
app/services/completion_kit/checks/expected_resolver.rb

Constant Summary collapse

UNRESOLVED =
TargetResolver::UNRESOLVED

Class Method Summary collapse

Class Method Details

.call(response, config) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/services/completion_kit/checks/expected_resolver.rb', line 6

def self.call(response, config)
  raw = response.expected_output
  return UNRESOLVED if raw.blank?

  path = config["expected_path"].to_s.strip
  return raw.to_s if path.empty?

  TargetResolver.resolve_json_path(raw.to_s, path)
end