Class: Pregunta
- Inherits:
-
Object
- Object
- Pregunta
- Includes:
- Comparable
- Defined in:
- lib/simpleselect/pregunta.rb
Overview
Clase que define una pregunta
Direct Known Subclasses
Instance Attribute Summary collapse
-
#dif ⇒ Fixnum
readonly
valoracion de la dificultad de la pregunta.
-
#preg ⇒ string
readonly
almacena la pregunta.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(preg, dif) ⇒ Pregunta
constructor
A new instance of Pregunta.
- #to_s ⇒ Object
Constructor Details
#initialize(preg, dif) ⇒ Pregunta
Returns a new instance of Pregunta.
9 10 11 12 |
# File 'lib/simpleselect/pregunta.rb', line 9 def initialize (preg, dif) @preg = preg @dif = dif end |
Instance Attribute Details
#dif ⇒ Fixnum (readonly)
valoracion de la dificultad de la pregunta
5 6 7 |
# File 'lib/simpleselect/pregunta.rb', line 5 def dif @dif end |
#preg ⇒ string (readonly)
almacena la pregunta
5 6 7 |
# File 'lib/simpleselect/pregunta.rb', line 5 def preg @preg end |
Instance Method Details
#<=>(other) ⇒ Object
17 18 19 |
# File 'lib/simpleselect/pregunta.rb', line 17 def <=> (other) @dif <=> other.dif end |
#to_s ⇒ Object
13 14 15 16 |
# File 'lib/simpleselect/pregunta.rb', line 13 def to_s aux = @preg + "\n" aux end |