Class: ACTV::SearchResults

Inherits:
Base
  • Object
show all
Defined in:
lib/actv/search_results.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, from_response, #initialize, #memoize, #method_missing, object_attr_reader, #respond_to?, #to_hash, 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

#items_per_pageObject (readonly)

Returns the value of attribute items_per_page.



7
8
9
# File 'lib/actv/search_results.rb', line 7

def items_per_page
  @items_per_page
end

#start_indexObject (readonly)

Returns the value of attribute start_index.



7
8
9
# File 'lib/actv/search_results.rb', line 7

def start_index
  @start_index
end

#total_resultsObject (readonly)

Returns the value of attribute total_results.



7
8
9
# File 'lib/actv/search_results.rb', line 7

def total_results
  @total_results
end

Instance Method Details

#facet_valuesArray<ACTV::FacetValue>

Returns:



24
25
26
27
28
# File 'lib/actv/search_results.rb', line 24

def facet_values
  @facet_values ||= Array(@attrs[:facet_values]).map do |facet_value|
    ACTV::FacetValue.new(facet_value)
  end
end

#facetsArray<ACTV::Facet>

Returns:



17
18
19
20
21
# File 'lib/actv/search_results.rb', line 17

def facets
  @facets ||= Array(@attrs[:facets]).map do |facet|
    ACTV::Facet.new(facet)
  end
end

#resultsArray<ACTV::Asset>

Returns:



10
11
12
13
14
# File 'lib/actv/search_results.rb', line 10

def results
  @results ||= Array(@attrs[:results]).map do |asset|
    ACTV::Asset.new(asset)
  end
end