Class: DmtdVbmappData::GuideChapterSection
- Inherits:
-
Object
- Object
- DmtdVbmappData::GuideChapterSection
- Defined in:
- lib/dmtd_vbmapp_data/guide_chapter_section.rb
Overview
Provides for the retrieving of VB-MAPP Guide chapter sections from the VB-MAPP Data Server.
Instance Attribute Summary collapse
-
#chapter_num ⇒ Object
readonly
Returns the value of attribute chapter_num.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#section_num ⇒ Object
readonly
Returns the value of attribute section_num.
Instance Method Summary collapse
-
#content ⇒ String
The content of the Guide’s chapter section.
-
#initialize(opts) ⇒ GuideChapterSection
constructor
Creates an accessor for the VB-MAPP Guide Chapter Section on the VB-MAPP Data Server.
- #title ⇒ Object
Constructor Details
#initialize(opts) ⇒ GuideChapterSection
Note:
This method does not block, simply creates an accessor and returns
Creates an accessor for the VB-MAPP Guide Chapter Section on the VB-MAPP Data Server
33 34 35 36 37 38 39 40 |
# File 'lib/dmtd_vbmapp_data/guide_chapter_section.rb', line 33 def initialize(opts) @client = opts.fetch(:client) @chapter_num = opts.fetch(:chapter_num).to_i @section_num = opts.fetch(:section_num).to_i index_json = opts.fetch(:section_index_json) @title = index_json[:title] end |
Instance Attribute Details
#chapter_num ⇒ Object (readonly)
Returns the value of attribute chapter_num.
14 15 16 |
# File 'lib/dmtd_vbmapp_data/guide_chapter_section.rb', line 14 def chapter_num @chapter_num end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/dmtd_vbmapp_data/guide_chapter_section.rb', line 10 def client @client end |
#section_num ⇒ Object (readonly)
Returns the value of attribute section_num.
18 19 20 |
# File 'lib/dmtd_vbmapp_data/guide_chapter_section.rb', line 18 def section_num @section_num end |
Instance Method Details
#content ⇒ String
Note:
This method does block as the content is retrieved
Returns The content of the Guide’s chapter section.
45 46 47 48 49 |
# File 'lib/dmtd_vbmapp_data/guide_chapter_section.rb', line 45 def content @content = retrieve_guide_section[:content] if @content.nil? @content end |
#title ⇒ Object
22 23 24 |
# File 'lib/dmtd_vbmapp_data/guide_chapter_section.rb', line 22 def title @title end |