Class: Isurvey::Answer

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

Instance Attribute Summary collapse

Attributes included from Base

#hash

Class Method Summary collapse

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 Attribute Details

#result_idObject

Returns the value of attribute result_id.



5
6
7
# File 'lib/isurvey/answer.rb', line 5

def result_id
  @result_id
end

Class Method Details

.by_result_id(id) ⇒ Object



11
12
13
14
15
# File 'lib/isurvey/answer.rb', line 11

def self.by_result_id(id)
  all.select do |answer|
    answer.result_id == id
  end
end

Instance Method Details

#questionObject



7
8
9
# File 'lib/isurvey/answer.rb', line 7

def question
  Question.find_by_screen_id(self.screen_id)
end