Class: DmtdVbmappData::ProtocolArea
- Inherits:
-
Object
- Object
- DmtdVbmappData::ProtocolArea
- Defined in:
- lib/dmtd_vbmapp_data/protocol_area.rb
Overview
Provides for the retrieving of VB-MAPP Protocol Area information from the VB-MAPP Data Server.
Instance Attribute Summary collapse
-
#area ⇒ Object
readonly
Returns the value of attribute area.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#groups ⇒ Array<ProtocolAreaGroup>
All of the VB-Mapp’s ProtocolAreaGroup instances.
-
#initialize(opts) ⇒ ProtocolArea
constructor
Creates an accessor for the VB-MAPP Guide Chapter on the VB-MAPP Data Server.
Constructor Details
#initialize(opts) ⇒ ProtocolArea
Note:
This method does not block, simply creates an accessor and returns
Creates an accessor for the VB-MAPP Guide Chapter on the VB-MAPP Data Server
23 24 25 26 27 28 29 |
# 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 |
Instance Attribute Details
#area ⇒ Object (readonly)
Returns the value of attribute area.
14 15 16 |
# File 'lib/dmtd_vbmapp_data/protocol_area.rb', line 14 def area @area end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/dmtd_vbmapp_data/protocol_area.rb', line 10 def client @client end |
Instance Method Details
#groups ⇒ Array<ProtocolAreaGroup>
Note:
This method does not block on server access
Returns all of the VB-Mapp’s DmtdVbmappData::ProtocolAreaGroup instances.
34 35 36 37 38 39 40 |
# 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 |