Class: Querinator::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/querinator/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Query

Returns a new instance of Query.



3
4
5
6
7
8
# File 'lib/querinator/query.rb', line 3

def initialize (args)
  @question = args[:question]
  @answer   = args[:answer]
  @times_correct = args[:times_correct]
  @times_seen = args[:times_seen]
end

Instance Method Details

#answerObject



18
19
20
# File 'lib/querinator/query.rb', line 18

def answer
  @answer
end

#is_correct?(response) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/querinator/query.rb', line 14

def is_correct?(response)
  response == @answer ? TRUE : FALSE
end

#poseObject



10
11
12
# File 'lib/querinator/query.rb', line 10

def pose
  @question
end

#times_correctObject



22
23
24
# File 'lib/querinator/query.rb', line 22

def times_correct
  @times_correct
end

#times_correct=(value) ⇒ Object



26
27
28
# File 'lib/querinator/query.rb', line 26

def times_correct=(value)
  @times_correct = value
end

#times_seenObject



30
31
32
# File 'lib/querinator/query.rb', line 30

def times_seen
  @times_seen
end

#times_seen=(value) ⇒ Object



34
35
36
# File 'lib/querinator/query.rb', line 34

def times_seen=(value)
  @times_seen = value
end