Class: Querinator::Query
- Inherits:
-
Object
- Object
- Querinator::Query
- Defined in:
- lib/querinator/query.rb
Instance Method Summary collapse
- #answer ⇒ Object
-
#initialize(args) ⇒ Query
constructor
A new instance of Query.
- #is_correct?(response) ⇒ Boolean
- #pose ⇒ Object
- #times_correct ⇒ Object
- #times_correct=(value) ⇒ Object
- #times_seen ⇒ Object
- #times_seen=(value) ⇒ Object
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
#answer ⇒ Object
18 19 20 |
# File 'lib/querinator/query.rb', line 18 def answer @answer end |
#is_correct?(response) ⇒ Boolean
14 15 16 |
# File 'lib/querinator/query.rb', line 14 def is_correct?(response) response == @answer ? TRUE : FALSE end |
#pose ⇒ Object
10 11 12 |
# File 'lib/querinator/query.rb', line 10 def pose @question end |
#times_correct ⇒ Object
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_seen ⇒ Object
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 |