Module: AnswerHelpers
- Defined in:
- lib/potassium/helpers/answer-helpers.rb
Instance Method Summary collapse
Instance Method Details
#answer(key, &fallback) ⇒ Object
2 3 4 5 |
# File 'lib/potassium/helpers/answer-helpers.rb', line 2 def answer(key, &fallback) found = get(:answers)[key] found.nil? ? fallback.call : found end |
#load_answers ⇒ Object
7 8 9 |
# File 'lib/potassium/helpers/answer-helpers.rb', line 7 def load_answers set(:answers, extract_answers(self.class.)) end |