Class: SearchResult
- Inherits:
-
Object
- Object
- SearchResult
- Includes:
- Paginateable
- Defined in:
- lib/mas/search_result.rb
Instance Attribute Summary collapse
-
#current_page ⇒ Object
readonly
Returns the value of attribute current_page.
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #firms ⇒ Object
-
#initialize(response, page: 1) ⇒ SearchResult
constructor
A new instance of SearchResult.
Methods included from Paginateable
#first_record, #last_record, #page_size, #total_pages, #total_records
Constructor Details
#initialize(response, page: 1) ⇒ SearchResult
Returns a new instance of SearchResult.
6 7 8 9 |
# File 'lib/mas/search_result.rb', line 6 def initialize(response, page: 1) @raw_response = response @current_page = page end |
Instance Attribute Details
#current_page ⇒ Object (readonly)
Returns the value of attribute current_page.
4 5 6 |
# File 'lib/mas/search_result.rb', line 4 def current_page @current_page end |
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
4 5 6 |
# File 'lib/mas/search_result.rb', line 4 def raw_response @raw_response end |
Instance Method Details
#firms ⇒ Object
11 12 13 14 15 |
# File 'lib/mas/search_result.rb', line 11 def firms return [] unless raw_response.status.ok? @firms ||= hits.map { |hit| FirmResult.new(hit) } end |