Class: SimpleChoice
- Inherits:
-
QuestionFather
- Object
- QuestionFather
- SimpleChoice
- Defined in:
- lib/question/simpleChoice/base.rb
Instance Attribute Summary collapse
-
#distractor ⇒ Object
Returns the value of attribute distractor.
-
#right ⇒ Object
Returns the value of attribute right.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from QuestionFather
Instance Method Summary collapse
-
#initialize(args) ⇒ SimpleChoice
constructor
A new instance of SimpleChoice.
- #to_s ⇒ Object
Methods inherited from QuestionFather
Constructor Details
#initialize(args) ⇒ SimpleChoice
Returns a new instance of SimpleChoice.
5 6 7 |
# File 'lib/question/simpleChoice/base.rb', line 5 def initialize(args) super end |
Instance Attribute Details
#distractor ⇒ Object
Returns the value of attribute distractor.
4 5 6 |
# File 'lib/question/simpleChoice/base.rb', line 4 def distractor @distractor end |
#right ⇒ Object
Returns the value of attribute right.
4 5 6 |
# File 'lib/question/simpleChoice/base.rb', line 4 def right @right end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/question/simpleChoice/base.rb', line 4 def text @text end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 |
# File 'lib/question/simpleChoice/base.rb', line 9 def to_s = @distractor + [@right] = .shuffle puts "- Elige la pregunta correcta de la siguiente pregunta #{@text} ?" .each {|o|} end |