Class: Conquiro::SearchAPI::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/conquiro/search_api/result.rb

Class Method Summary collapse

Class Method Details

.result_for(attributes) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/conquiro/search_api/result.rb', line 6

def self.result_for(attributes)
  wrapper_type = attributes.delete(:wrapperType)
  case wrapper_type
    when /software/i then Conquiro::Software.new(attributes)
    else raise "Unsupported result type: #{wrapper_type}."
  end
end