Class: Polytexnic::Literal::IncludedSectionReader

Inherits:
IncludedFileReader show all
Defined in:
lib/polytexnic/literal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



303
304
305
# File 'lib/polytexnic/literal.rb', line 303

def lines
  @lines
end

#sectionnameObject (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

Raises:



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