Class: SynapsePayRest::Question Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse_pay_rest/models/user/question.rb

Overview

Deprecated.

Represents a question that is triggered when a document is returned with status MFA|PENDING.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, question:, answers:) ⇒ Question

Note:

This is initialized automatically by SynapsePayRest::VirtualDocument.

Returns a new instance of Question.



18
19
20
21
22
23
# File 'lib/synapse_pay_rest/models/user/question.rb', line 18

def initialize(id:, question:, answers:)
  @id       = id
  @question = question
  @answers  = answers
  @choice   = nil
end

Instance Attribute Details

#answersHash{Integer=>String} (readonly)

Returns the answer choice numbers and text.

Returns:

  • (Hash{Integer=>String})

    the answer choice numbers and text



15
# File 'lib/synapse_pay_rest/models/user/question.rb', line 15

attr_reader :question, :answers, :id, :choice

#choiceObject

Returns the value of attribute choice.



15
# File 'lib/synapse_pay_rest/models/user/question.rb', line 15

attr_reader :question, :answers, :id, :choice

#idInteger (readonly)

Returns the number of the question in the question_set.

Returns:

  • (Integer)

    the number of the question in the question_set



15
# File 'lib/synapse_pay_rest/models/user/question.rb', line 15

attr_reader :question, :answers, :id, :choice

#questionString (readonly)

Returns the text of the question.

Returns:

  • (String)

    the text of the question



15
16
17
# File 'lib/synapse_pay_rest/models/user/question.rb', line 15

def question
  @question
end

Instance Method Details

#to_hashObject

Note:

You should not need to call this directly.

Converts the question/answer to a hash for use in JSON.



43
44
45
# File 'lib/synapse_pay_rest/models/user/question.rb', line 43

def to_hash
  {'question_id' => id, 'answer_id' => choice}
end