lib/endeca/document_collection.rb in primedia-endeca-0.9.5 vs lib/endeca/document_collection.rb in primedia-endeca-0.9.6

- old
+ new

@@ -65,9 +65,15 @@ # The collection of Refinement objects for the collection. def refinements @refinements ||= (@raw['Refinements'] || []).map(&Refinement) end + # Return the uri for the refinement by name + def refinement_uri_by_name(name) + refinement = refinements.find{|ref| ref.name.downcase == name.downcase} + refinement.to_params if refinement + end + # List of array methods (that are not in +Object+) that need to be # delegated to +documents+. ARRAY_METHODS = (Array.instance_methods - Object.instance_methods).map { |n| n.to_s } # List of additional methods that must be delegated to +documents+.