Class: QnAMaker::Answer

Inherits:
Object
  • Object
show all
Defined in:
lib/qna_maker/answer.rb

Overview

Answer class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(answer, questions, score) ⇒ Answer

Creates an object for storing data about answer.

Parameters:

  • answer (String)

    text

  • questions (Array<String>)

    list of questions for asked question

  • score (Float)

    probability that answer suits asked question



15
16
17
18
19
# File 'lib/qna_maker/answer.rb', line 15

def initialize(answer, questions, score)
  @answer = answer
  @questions = questions
  @score = score
end

Instance Attribute Details

#answerObject (readonly)

Returns the value of attribute answer.



6
7
8
# File 'lib/qna_maker/answer.rb', line 6

def answer
  @answer
end

#questionsObject (readonly)

Returns the value of attribute questions.



6
7
8
# File 'lib/qna_maker/answer.rb', line 6

def questions
  @questions
end

#scoreObject (readonly)

Returns the value of attribute score.



6
7
8
# File 'lib/qna_maker/answer.rb', line 6

def score
  @score
end