module Mexico::Constants::ParticipantRoles

This module lists all participant roles that are part of the current MExiCo model.

Constants

ALL

A collection of all participant roles currently predefined.

CONFEDERATE

A participant who has been instructed and informed about the experiment in at least one aspect, and who pretends to be naive to other participants

NAIVE

A naive participant who does not have additional background information about the experiment

OTHER

container for all other roles

Public Class Methods

get(key) click to toggle source

retrieves a participant role object by its key. @param [String] key The key of the needed participant role. @return [Mexico::FileSystem::ParticipantRole,nil] the participant role object, or nil, if no object was found.

# File lib/mexico/constants.rb, line 47
def self.get(key)
  ::Mexico::Constants::ParticipantRoles::ALL.first{ |x| x.identifier==key}  
end
has?(key) click to toggle source

checks for the existence of a predefined participant role object. @param [String] key The key of the needed participant role. @return [true,false] true iff such a participant role object exists, false otherwise.

# File lib/mexico/constants.rb, line 54
def self.has?(key)
  ::Mexico::Constants::ParticipantRoles::ALL.select{ |x| x.identifier==key}.size>0
end