class DmtdVbmappData::ProtocolAreaQuestion
Provides for the retrieving of VB-MAPP Area Question on the VB-MAPP Data Server.
Attributes
@!attribute [r] area
@return [Symbol] the area of the question (e.g. :milestones, :barriers, :transitions, :eesa)
@!attribute [r] client
@return [Client] the associated client
@!attribute [r] definition
@return [String] the formal definition for the question
@!attribute [r] example
@return [String] an example of administering the question
@!attribute [r] group
@return [Symbol] the group of the question (e.g. :mand, :tact, :group1, etc.)
@!attribute [r] level
@return [Integer] the level number of the question (only when area == :milestones)
@!attribute [r] materials
@return [String] the materials required to administer the question
@!attribute [r] number
@return [Integer] the question number (0...n)
@!attribute [r] objective
@return [String] The objective of the question
@!attribute [r] skills
@return [Skill] the set of Task Analysis Skills for the question
@!attribute [r] text
@return [String] the text of the question itself
@!attribute [r] title
@return [String] a title to display at the top of a grid column
Public Class Methods
Creates an accessor for the VB-MAPP Area Question on the VB-MAPP Data Server
@note This method does not block, simply creates an accessor and returns
@option opts [Client] :client A client instance @option opts [String | Symbol] :area The vbmapp area of the group ('milestones', 'barriers', 'transitions', 'eesa') @option opts [String | Symbol] :group The vbmapp area group name (i.e. 'mand', 'tact', 'group1', etc.) @option opts [Hash] :question_json The vbmapp question json for the question in the format described at
{https://datamtd.atlassian.net/wiki/pages/viewpage.action?pageId=18710549 /1/protocol/area_question - GET REST api - Fields}
# File lib/dmtd_vbmapp_data/protocol_area_question.rb, line 65 def initialize(opts) @client = opts.fetch(:client) @area = opts.fetch(:area).to_sym @group = opts.fetch(:group).to_sym question_json = opts.fetch(:question_json) @definition = question_json[:definition] @objective = question_json[:objective] @example = question_json[:example] @materials = question_json[:materials] @number = question_json[:number].to_i @text = question_json[:text] @title = question_json[:title] @level = question_json[:level] @responses_json_array = question_json[:responses] skills = question_json[:skills] @skills = if skills.nil? [] else question_json[:skills].map do |skill| ProtocolAreaSkill.new(question_json: skill) end end end
Public Instance Methods
@note This method does not block.
@return [Array<ProtocolAreaResponse>] all of the VB-MAPP question's possible responses
# File lib/dmtd_vbmapp_data/protocol_area_question.rb, line 94 def responses @responses = @responses_json_array.map { |response_json| ProtocolAreaResponse.new(area: area, response_json: response_json) } if @responses.nil? @responses end