Class: Rafflesia::OntologyContexts
- Inherits:
-
Object
- Object
- Rafflesia::OntologyContexts
- Defined in:
- lib/rafflesia/ontology_contexts.rb
Instance Method Summary collapse
-
#get(q: nil, relation: nil, neighbor_hops: 1, max_relations: 8, max_columns: 24, request_options: {}) ⇒ Rafflesia::EnvelopeOntologyContextData
GET /v1/ontology_contexts.
-
#initialize(client) ⇒ OntologyContexts
constructor
A new instance of OntologyContexts.
Constructor Details
#initialize(client) ⇒ OntologyContexts
Returns a new instance of OntologyContexts.
9 10 11 |
# File 'lib/rafflesia/ontology_contexts.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#get(q: nil, relation: nil, neighbor_hops: 1, max_relations: 8, max_columns: 24, request_options: {}) ⇒ Rafflesia::EnvelopeOntologyContextData
GET /v1/ontology_contexts
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rafflesia/ontology_contexts.rb', line 21 def get( q: nil, relation: nil, neighbor_hops: 1, max_relations: 8, max_columns: 24, request_options: {} ) params = { 'q' => q, 'relation' => relation, 'neighbor_hops' => neighbor_hops, 'max_relations' => max_relations, 'max_columns' => max_columns }.compact response = @client.request( method: :get, path: '/v1/ontology_contexts', auth: true, params: params, request_options: ) result = Rafflesia::EnvelopeOntologyContextData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |