Module: Mangadex::Api

Defined in:
lib/mangadex/api/user.rb,
lib/mangadex/api/context.rb,
lib/mangadex/api/version.rb,
lib/mangadex/api/response.rb

Defined Under Namespace

Classes: Context, Response, User

Constant Summary collapse

VERSION =
-> do
  version = Psych.load(
    RestClient.get(
      'https://api.mangadex.org/api.yaml',
    ).body,
  ).dig('info', 'version')

  if version != Mangadex::VERSION
    warn(
      "[Warning] This gem is compatible with #{Mangadex::VERSION} but it looks like Mangadex is at #{version}",
      "[Warning] Check out #{Mangadex::Internal::Request::BASE_URI} for more information.",
    )
  end

  version
end.call