mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-13 19:07:10 +00:00
a19b9e90ec
`class Dog < Animal` exposes the base in the `superclass` field, but the inheritance handler in `_extract_generic` had branches for java/kotlin/c#/scala/cpp/php/swift/python and none for Ruby, so every Ruby `inherits` edge was silently dropped (contains/methods/calls unaffected). Add a Ruby branch that reads the `superclass` field, handling both a bare `constant` (`< Animal`) and a `scope_resolution` (`< Foo::Bar` -> Bar). Adds a subclass to the Ruby fixture and a regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
441 B
Ruby
34 lines
441 B
Ruby
require 'json'
|
|
require 'net/http'
|
|
|
|
class ApiClient
|
|
def initialize(base_url)
|
|
@base_url = base_url
|
|
end
|
|
|
|
def get(path)
|
|
fetch(path, 'GET')
|
|
end
|
|
|
|
def post(path, body)
|
|
fetch(path, 'POST')
|
|
end
|
|
|
|
private
|
|
|
|
def fetch(path, method)
|
|
uri = URI(@base_url + path)
|
|
Net::HTTP.get(uri)
|
|
end
|
|
end
|
|
|
|
class TimeoutApiClient < ApiClient
|
|
def fetch(path, method)
|
|
super
|
|
end
|
|
end
|
|
|
|
def parse_response(raw)
|
|
JSON.parse(raw)
|
|
end
|