Class: NLBSG::SearchResponse

Inherits:
ResponseBase show all
Defined in:
lib/nlbsg/response/search.rb

Instance Attribute Summary

Attributes inherited from ResponseBase

#response

Instance Method Summary collapse

Methods inherited from ResponseBase

#error_message, #message, #status

Constructor Details

#initialize(response) ⇒ SearchResponse

Returns a new instance of SearchResponse.



4
5
6
# File 'lib/nlbsg/response/search.rb', line 4

def initialize(response)
  super(response.to_hash[:search_response])
end

Instance Method Details

#fetch_next_recordsObject



24
25
26
# File 'lib/nlbsg/response/search.rb', line 24

def fetch_next_records
  p "TODO"
end

#next_record_positionObject



12
13
14
# File 'lib/nlbsg/response/search.rb', line 12

def next_record_position
  @response[:next_record_position]
end

#set_idObject



16
17
18
# File 'lib/nlbsg/response/search.rb', line 16

def set_id
  @response[:set_id]
end

#titlesObject



20
21
22
# File 'lib/nlbsg/response/search.rb', line 20

def titles
  wrap_in_array(@response.dig(:titles, :title))
end

#total_recordsObject



8
9
10
# File 'lib/nlbsg/response/search.rb', line 8

def total_records
  @response[:total_records]
end