Class: Mindee::V2::Search::Models::ModelSearchResponse

Inherits:
Parsing::Search::BaseSearchResponse show all
Defined in:
lib/mindee/v2/search/models/model_search_response.rb,
sig/mindee/v2/search/models/model_search_response.rbs

Overview

Models search response.

Direct Known Subclasses

Parsing::Search::SearchResponse

Instance Attribute Summary collapse

Attributes inherited from Parsing::Search::BaseSearchResponse

#pagination

Attributes inherited from Parsing::CommonResponse

#raw_http

Instance Method Summary collapse

Methods inherited from Parsing::Search::BaseSearchResponse

#pagination_metadata, #to_s

Constructor Details

#initialize(raw_response) ⇒ ModelSearchResponse

Returns a new instance of ModelSearchResponse.

Parameters:

  • raw_response (Hash) —

    The parsed JSON payload from the API.

  • (Hash[String|Symbol, untyped])


13
14
15
16
17
# File 'lib/mindee/v2/search/models/model_search_response.rb', line 13

def initialize(raw_response)
  super

  @models = Mindee::V2::Parsing::Search::SearchModels.new(raw_response['models'])
end

Instance Attribute Details

#models ⇒ Mindee::V2::Parsing::Search::SearchModels (readonly)

Returns Paginated list of matching models.

Returns:



10
11
12
# File 'lib/mindee/v2/search/models/model_search_response.rb', line 10

def models
  @models
end

Instance Method Details

#body_lines ⇒ Array<String>

Lines composing the response-specific body (header + items).

Returns:

  • (Array<String>)


21
22
23
# File 'lib/mindee/v2/search/models/model_search_response.rb', line 21

def body_lines
  ['Models', '######', @models.to_s]
end