Sha256: 7d7855fc6fea220cbabe6d3ec2c01e0c2ad755ae5f38494a64cc715190484ab4
Contents?: true
Size: 550 Bytes
Versions: 17
Compression:
Stored size: 550 Bytes
Contents
module Screengem # # Common error to signal a question that was answered incorrectly. # class IncorrectAnswer < RuntimeError def initialize(question) super(extract_question_text(question)) end private # # Transforms question class name into a text message. # # Example: # # Questions::SignatureCapturedQuestion is transformed to 'Signature captured?'. # def extract_question_text(question) question.class.name.demodulize.underscore.humanize.gsub(" question", "?") end end end
Version data entries
17 entries across 17 versions & 1 rubygems