Class: Search::ResultsResponse
Constant Summary
Common::Client::Concerns::ServiceStatus::RESPONSE_STATUS
Instance Attribute Summary
Attributes inherited from Common::Base
#errors_hash
Class Method Summary
collapse
Instance Method Summary
collapse
#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes
Constructor Details
#initialize(status, pagination, attributes = nil) ⇒ ResultsResponse
Returns a new instance of ResultsResponse.
15
16
17
18
19
|
# File 'lib/search/response.rb', line 15
def initialize(status, , attributes = nil)
super(attributes) if attributes
self. =
self.status = status
end
|
Class Method Details
.from(response) ⇒ Object
21
22
23
24
|
# File 'lib/search/response.rb', line 21
def self.from(response)
= (response.body)
new(response.status, , body: response.body)
end
|
Instance Method Details
#cache? ⇒ Boolean
26
27
28
|
# File 'lib/search/response.rb', line 26
def cache?
status == 200
end
|
30
31
32
|
# File 'lib/search/response.rb', line 30
def metadata
{ status: response_status }
end
|
#response_status ⇒ Object