class DmtdVbmappData::ProtocolArea
Provides for the retrieving of VB-MAPP Protocol
Area information from the VB-MAPP Data Server.
Attributes
area[R]
@!attribute [r] area
@return [Symbol] the area of the question (e.g. :milestones, :barriers, :transitions, :eesa)
client[R]
@!attribute [r] client
@return [Client] the associated client
Public Class Methods
new(opts)
click to toggle source
Creates an accessor for the VB-MAPP Guide
Chapter 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 [Hash] :area_index_json The vbmapp area index json for the VB-Mapp Area in the format described at
{https://datamtd.atlassian.net/wiki/pages/viewpage.action?pageId=18710543 /1/protocol/index - GET REST api - Area Fields}
# File lib/dmtd_vbmapp_data/protocol_area.rb, line 23 def initialize(opts) @client = opts.fetch(:client) index_json = opts.fetch(:area_index_json) @area = index_json[:area].to_sym @groups_index = index_json[:groups] end
Public Instance Methods
groups()
click to toggle source
@note This method does not block on server access
@return [Array<ProtocolAreaGroup>] all of the VB-Mapp's {ProtocolAreaGroup} instances
# File lib/dmtd_vbmapp_data/protocol_area.rb, line 34 def groups @groups = @groups_index.map.with_index do |group_index_json, group_num| ProtocolAreaGroup.new(client: client, area: area, group_index_json: group_index_json) end if @groups.nil? @groups end