Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Evaluate Models

Nihad Abbasov edited this page Mar 30, 2015 · 5 revisions

Add or update an evaluation

add_evaluation(reputation_name, evaluation_value, source)

update_evaluation(reputation_name, evaluation_value, source)

add_or_update_evaluation(reputation_name, evaluation_value, source)

add_evaluation raises an exception if the source has already evaluated for the reputation. You can use add_or_update_evaluation to avoid this.

Add or delete an evaluation

add_or_delete_evaluation(reputation_name, evaluation_value, source)

Delete an evaluation

delete_evaluation(reputation_name, source)

delete_evaluation!(reputation_name, source)

delete_evaluation returns true or false, while delete_evaluation! raises an exception on failure.

Increase or decrease an evaluation value

With the following methods, you can increase and decrease evaluation value, instead of add or remove them. They add a new evaluation if it does not exist.

increase_evaluation(reputation_name, value, source)

decrease_evaluation(reputation_name, value, source)

Check if evaluated

You can check if the target record has already been evaluated by a given source:

has_evaluation?(reputation_name, source)

Get evaluation value

You can get evaluation value for the target record by a given source:

evaluation_by(reputation_name, source)

It will return nil if the target record hasn't been evaluated by a given source.