Class: ThatLanguage::Client::DetailsQuery

Inherits:
Query
  • Object
show all
Defined in:
lib/that_language/client/details_query.rb

Instance Attribute Summary

Attributes inherited from Query

#text

Instance Method Summary collapse

Methods inherited from Query

#initialize, #to_h

Constructor Details

This class inherits a constructor from ThatLanguage::Client::Query

Instance Method Details

#resultsObject



12
13
14
# File 'lib/that_language/client/details_query.rb', line 12

def results
  @results ||= json["results"].map { |result| OpenStruct.new(result) }
end

#winnerObject



8
9
10
# File 'lib/that_language/client/details_query.rb', line 8

def winner
  results.first
end