class Prct07::Question
Attributes
answer[RW]
text[RW]
Public Class Methods
new(text, answer)
click to toggle source
# File lib/prct07/quiz.rb, line 7 def initialize (text, answer) @text = text @answer = answer end
Public Instance Methods
to_s()
click to toggle source
# File lib/prct07/quiz.rb, line 12 def to_s aux = " " aux << text << "\n" i = 1 aux << "\t#{i}- #{answer[:right]}\n" answer[:wrong].each do |op| aux<<"\t#{i+=1}- #{op}\n" end aux end