Class: Polytexnic::Literal::IncludedSectionReader
- Inherits:
-
IncludedFileReader
- Object
- IncludedFileReader
- Polytexnic::Literal::IncludedSectionReader
- Defined in:
- lib/polytexnic/literal.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#sectionname ⇒ Object
readonly
Returns the value of attribute sectionname.
Instance Method Summary collapse
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
303 304 305 |
# File 'lib/polytexnic/literal.rb', line 303 def lines @lines end |
#sectionname ⇒ Object (readonly)
Returns the value of attribute sectionname.
303 304 305 |
# File 'lib/polytexnic/literal.rb', line 303 def sectionname @sectionname end |
Instance Method Details
#read(filename, sectionname) ⇒ Object
305 306 307 308 309 310 311 |
# File 'lib/polytexnic/literal.rb', line 305 def read(filename, sectionname) @lines = super @sectionname = sectionname raise(SectionNotFound, section_begin_text) unless exist? lines.slice(index_of_first_line, length) end |