Class: QuestionFather

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/question/questionFather/base.rb

Direct Known Subclasses

SimpleChoice, TrueOrFalse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ QuestionFather

Returns a new instance of QuestionFather.



6
7
8
9
10
11
# File 'lib/question/questionFather/base.rb', line 6

def initialize(args)
  @text = args[:text]
  @right = args[:right]
  @distractor = args[:distractor]
  @dif = args[:dif]
end

Instance Attribute Details

#difObject

Returns the value of attribute dif.



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def dif
  @dif
end

#distractorObject

Returns the value of attribute distractor.



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def distractor
  @distractor
end

#rightObject

Returns the value of attribute right.



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def right
  @right
end

#textObject

Returns the value of attribute text.



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def text
  @text
end

Instance Method Details

#<=>(other) ⇒ Object



12
13
14
# File 'lib/question/questionFather/base.rb', line 12

def <=>(other)
  self.dif <=> other.dif
end