Class: ACTV::SearchResults
Direct Known Subclasses
ArticleSearchResults, EventSearchResults, PopularInterestSearchResults, VideoSearchResults
Instance Attribute Summary collapse
-
#actual_query ⇒ Object
readonly
Returns the value of attribute actual_query.
-
#items_per_page ⇒ Object
readonly
Returns the value of attribute items_per_page.
-
#original_query ⇒ Object
readonly
Returns the value of attribute original_query.
-
#start_index ⇒ Object
readonly
Returns the value of attribute start_index.
-
#total_results ⇒ Object
readonly
Returns the value of attribute total_results.
Attributes inherited from Base
Instance Method Summary collapse
- #facet_values ⇒ Array<ACTV::FacetValue>
- #facets ⇒ Array<ACTV::Facet>
- #results ⇒ Object (also: #to_a)
- #suggestions ⇒ Object
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, #delete, from_response, #initialize, #memoize, #method_missing, object_attr_reader, #respond_to?, #to_hash, #update, uri_attr_reader
Constructor Details
This class inherits a constructor from ACTV::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ACTV::Base
Instance Attribute Details
#actual_query ⇒ Object (readonly)
Returns the value of attribute actual_query.
8 9 10 |
# File 'lib/actv/search_results.rb', line 8 def actual_query @actual_query end |
#items_per_page ⇒ Object (readonly)
Returns the value of attribute items_per_page.
8 9 10 |
# File 'lib/actv/search_results.rb', line 8 def items_per_page @items_per_page end |
#original_query ⇒ Object (readonly)
Returns the value of attribute original_query.
8 9 10 |
# File 'lib/actv/search_results.rb', line 8 def original_query @original_query end |
#start_index ⇒ Object (readonly)
Returns the value of attribute start_index.
8 9 10 |
# File 'lib/actv/search_results.rb', line 8 def start_index @start_index end |
#total_results ⇒ Object (readonly)
Returns the value of attribute total_results.
8 9 10 |
# File 'lib/actv/search_results.rb', line 8 def total_results @total_results end |
Instance Method Details
#facet_values ⇒ Array<ACTV::FacetValue>
26 27 28 29 30 |
# File 'lib/actv/search_results.rb', line 26 def facet_values @facet_values ||= Array(@attrs[:facet_values]).map do |facet_value| ACTV::FacetValue.new(facet_value) end end |
#facets ⇒ Array<ACTV::Facet>
19 20 21 22 23 |
# File 'lib/actv/search_results.rb', line 19 def facets @facets ||= Array(@attrs[:facets]).map do |facet| ACTV::Facet.new(facet) end end |
#results ⇒ Object Also known as: to_a
10 11 12 13 14 15 |
# File 'lib/actv/search_results.rb', line 10 def results @results ||= Array(@attrs[:results]).map do |asset| response = { body: asset } ACTV::Asset.from_response response end end |
#suggestions ⇒ Object
32 33 34 35 36 |
# File 'lib/actv/search_results.rb', line 32 def suggestions @suggestions ||= Array(@attrs[:suggestions]).map do |suggestion| ACTV::Suggestion.new(suggestion) end end |