Class Prompt
In: app/models/prompt.rb
Parent: ActiveRecord::Base

Methods

fetch  

Included Modules

Algorithms::Prompt

Classes and Modules

Module Prompt::Extremes
Module Prompt::Popular
Module Prompt::Random

Public Class methods

Create prompts based on conditions. If prime is true items used in prompts are relative to their stats values. Otherwise items used are randomly chosen.

Return

Array of prompt ids.

Parameters

question_id<int>:The question id.
voter_id<int>:The voter id.
count<int>:The number of prompts to generate.
algo<int>:If exists, id of prompt algorithm to use.

Otherwise not.

[Source]

    # File app/models/prompt.rb, line 26
26:     def fetch(question_id, voter_id, count, algo)
27:       Item.count(conditions(question_id)) > 1 ? create_prompts(question_id, voter_id, count, algo) : {}
28:     end

[Validate]