class Attune::Model::BatchRankingResult
Array of ranking results.
@attr [Array<Attune::Model::RankedEntities>] results Array of rankings in order of the parameters provided as input.
Constants
- ATTRIBUTE_MAP
:internal => :external
Attributes
results[RW]
Public Class Methods
new(attributes = {})
click to toggle source
# File lib/attune/models/batch_ranking_result.rb, line 10 def initialize(attributes = {}) return if attributes.empty? value = attributes["results"] || attributes[:"results"] if value.is_a?(Array) @results = value.map{ |v| RankedEntities.new(v) } end end
Public Instance Methods
to_body()
click to toggle source
# File lib/attune/models/batch_ranking_result.rb, line 21 def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end
to_json(options = {})
click to toggle source
# File lib/attune/models/batch_ranking_result.rb, line 28 def to_json(options = {}) to_body.to_json end