Class: HumanizerHelper

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, Humanizer
Defined in:
lib/humanizer_helper.rb

Constant Summary

Constants included from Humanizer

Humanizer::VERSION

Instance Attribute Summary

Attributes included from Humanizer

#humanizer_answer, #humanizer_question_id

Instance Method Summary collapse

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(options={})
  options[:humanizer_question_id] = options[:humanizer_question_id].to_i unless options[:humanizer_question_id].nil?
  options.each do |k, v|
    self.send("#{k}=", v)
  end

  humanizer_question_id
end

Instance Method Details

#get_correct_humanizer_answerObject



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