Class: SimpleSDKBuilder::SearchResults
- Inherits:
-
Object
- Object
- SimpleSDKBuilder::SearchResults
- Defined in:
- lib/simple_sdk_builder/search_results.rb
Instance Attribute Summary collapse
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#result_count ⇒ Object
readonly
Returns the value of attribute result_count.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
-
#initialize(response, type) ⇒ SearchResults
constructor
A new instance of SearchResults.
Constructor Details
#initialize(response, type) ⇒ SearchResults
Returns a new instance of SearchResults.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/simple_sdk_builder/search_results.rb', line 6 def initialize(response, type) @result_count = response.headers['X-Count'].to_s.to_i @links = {} response.headers['Link'].to_s.split(',').each do |link| if link =~ /<(.*)>; rel="(.*)"/ @links[$2] = $1 end end @results = response.build(type) end |
Instance Attribute Details
#links ⇒ Object (readonly)
Returns the value of attribute links.
4 5 6 |
# File 'lib/simple_sdk_builder/search_results.rb', line 4 def links @links end |
#result_count ⇒ Object (readonly)
Returns the value of attribute result_count.
4 5 6 |
# File 'lib/simple_sdk_builder/search_results.rb', line 4 def result_count @result_count end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
4 5 6 |
# File 'lib/simple_sdk_builder/search_results.rb', line 4 def results @results end |