class Quiz::Question
Attributes
answers[R]
enun[R]
Public Class Methods
new(enun, answers)
click to toggle source
# File lib/quiz.rb, line 8 def initialize (enun, answers) @enun = enun @answers = answers end
Public Instance Methods
to_s()
click to toggle source
# File lib/quiz.rb, line 13 def to_s out = "" out << enun << "\n" n = 1 out << "\n\t #{n}.- #{answers[:right]}\n" n+=1 answers[:wrong].each do |op| out<<"\t #{n}.- #{op}\n" n+=1 end out end