Sha256: 86f713d9c0bbfbfe0df42a13d0d47f92fbd7499deb642cfa250a2fb47e5eda34
Contents?: true
Size: 893 Bytes
Versions: 15
Compression:
Stored size: 893 Bytes
Contents
module Attune module Model # Array of ranking results. # # @attr [Array<Attune::Model::RankedEntities>] results Array of rankings in order of the parameters provided as input. class BatchRankingResult attr_accessor :results 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 def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end def to_json(options = {}) to_body.to_json end private # :internal => :external ATTRIBUTE_MAP = { :results => :results } end end end
Version data entries
15 entries across 15 versions & 1 rubygems