Class: DuoSplitter::Models::Section
- Inherits:
-
Object
- Object
- DuoSplitter::Models::Section
- Defined in:
- lib/duo_splitter/models/section.rb
Instance Attribute Summary collapse
-
#audio_path ⇒ Object
Returns the value of attribute audio_path.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(number:) ⇒ Section
constructor
A new instance of Section.
- #sentences(intro: true) ⇒ Object
Constructor Details
#initialize(number:) ⇒ Section
Returns a new instance of Section.
10 11 12 13 |
# File 'lib/duo_splitter/models/section.rb', line 10 def initialize(number:) @number = number @sentences = load_sentences end |
Instance Attribute Details
#audio_path ⇒ Object
Returns the value of attribute audio_path.
8 9 10 |
# File 'lib/duo_splitter/models/section.rb', line 8 def audio_path @audio_path end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
6 7 8 |
# File 'lib/duo_splitter/models/section.rb', line 6 def number @number end |
Instance Method Details
#sentences(intro: true) ⇒ Object
15 16 17 |
# File 'lib/duo_splitter/models/section.rb', line 15 def sentences(intro: true) @sentences.reject {|sentence| !intro && sentence.intro? } end |