Class: CSKit::Lesson::Section
- Inherits:
-
Object
- Object
- CSKit::Lesson::Section
- Defined in:
- lib/cskit/lesson/section.rb
Instance Attribute Summary collapse
-
#citation_texts ⇒ Object
readonly
Returns the value of attribute citation_texts.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #each_reading_group_for(volume_name) ⇒ Object
-
#initialize(name, citation_texts) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(name, citation_texts) ⇒ Section
Returns a new instance of Section.
9 10 11 12 |
# File 'lib/cskit/lesson/section.rb', line 9 def initialize(name, citation_texts) @name = name @citation_texts = citation_texts end |
Instance Attribute Details
#citation_texts ⇒ Object (readonly)
Returns the value of attribute citation_texts.
7 8 9 |
# File 'lib/cskit/lesson/section.rb', line 7 def citation_texts @citation_texts end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/cskit/lesson/section.rb', line 7 def name @name end |
Instance Method Details
#each_reading_group_for(volume_name) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/cskit/lesson/section.rb', line 14 def each_reading_group_for(volume_name) volume_name = volume_name.to_sym volume = CSKit.get_volume(volume_name) (citation_texts[volume_name] || []).each do |citation_text| citation = volume.parse_citation(citation_text) yield volume.readings_for(citation), citation end end |