Class: Instrument

Inherits:
ApplicationRecord show all
Includes:
Discard::Model, PgSearch
Defined in:
app/models/instrument.rb

Overview

Represents a psychometric instrument Similar to a survey or questionnaire

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationRecord

#==

Class Method Details

.list_tests(limit: 4) ⇒ Object


40
41
42
# File 'app/models/instrument.rb', line 40

def self.list_tests(limit: 4)
  Instrument.order(:name).limit(limit).join(' ')
end

Instance Method Details

#first_question_and_instructionsObject


48
49
50
# File 'app/models/instrument.rb', line 48

def first_question_and_instructions
  %(#{instructions} #{items.first.title})
end

#to_sObject


44
45
46
# File 'app/models/instrument.rb', line 44

def to_s
  name
end