Class: CTG

Inherits:
Object
  • Object
show all
Defined in:
lib/ctg/response.rb,
lib/ctg/response/csv_response.rb,
lib/ctg/response/json_response.rb

Overview

This file defines the CTG::Response class, which serves as a wrapper around the response returned by the ClinicalTrials.gov API. The Response class provides a common interface for working with different response formats (JSON, CSV) and supports functionalities like pagination, querying by keys.

The CTG::Response class delegates the format-specific behavior to its subclasses, CTG::Response::JSONResponse and CTG::Response::CSVResponse.

Methods:

  • ‘parse`: Factory method that returns an appropriate response object (JSON or CSV).

  • ‘query`: Queries the response data by keys.

  • ‘next_page`: Next page (if page token exists)

Defined Under Namespace

Classes: Response