Class: Isurvey::Question

Inherits:
Object
  • Object
show all
Extended by:
Collector
Includes:
Base
Defined in:
lib/isurvey/question.rb

Instance Attribute Summary

Attributes included from Base

#hash

Instance Method Summary collapse

Methods included from Collector

[], all, first, method_missing

Methods included from Base

#initialize, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Isurvey::Base

Instance Method Details

#answersObject



6
7
8
# File 'lib/isurvey/question.rb', line 6

def answers
  Answer.find_by_screen_id(self.screen_id)
end

#answers_by_result_id(id) ⇒ Object



10
11
12
13
14
# File 'lib/isurvey/question.rb', line 10

def answers_by_result_id(id)
  answers.select do |answer|
    answer.result_id == id
  end
end