Class: HumanizerHelper
- Inherits:
-
Object
- Object
- HumanizerHelper
- Includes:
- ActiveModel::Validations, Humanizer
- Defined in:
- lib/humanizer_helper.rb
Constant Summary
Constants included from Humanizer
Instance Attribute Summary
Attributes included from Humanizer
#humanizer_answer, #humanizer_question_id
Instance Method Summary collapse
- #get_correct_humanizer_answer ⇒ Object
-
#initialize(options = {}) ⇒ HumanizerHelper
constructor
A new instance of HumanizerHelper.
Methods included from Humanizer
#change_humanizer_question, #humanizer_correct_answer?, #humanizer_question, included
Constructor Details
#initialize(options = {}) ⇒ HumanizerHelper
Returns a new instance of HumanizerHelper.
5 6 7 8 9 10 11 12 |
# File 'lib/humanizer_helper.rb', line 5 def initialize(={}) [:humanizer_question_id] = [:humanizer_question_id].to_i unless [:humanizer_question_id].nil? .each do |k, v| self.send("#{k}=", v) end humanizer_question_id end |
Instance Method Details
#get_correct_humanizer_answer ⇒ Object
14 15 16 |
# File 'lib/humanizer_helper.rb', line 14 def get_correct_humanizer_answer humanizer_answers_for_id(humanizer_question_id.to_i)[0] end |