Class: Lab42::Literate::Extractor::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/lab42/literate/extractor/block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



2
3
4
# File 'lib/lab42/literate/extractor/block.rb', line 2

def lines
  @lines
end

#start_lnbObject (readonly)

Returns the value of attribute start_lnb.



2
3
4
# File 'lib/lab42/literate/extractor/block.rb', line 2

def start_lnb
  @start_lnb
end

#titleObject (readonly)

Returns the value of attribute title.



2
3
4
# File 'lib/lab42/literate/extractor/block.rb', line 2

def title
  @title
end

Instance Method Details

#add_line(line) ⇒ Object



4
5
6
# File 'lib/lab42/literate/extractor/block.rb', line 4

def add_line line
  lines << line
end

#get_title(alternative) ⇒ Object



8
9
10
# File 'lib/lab42/literate/extractor/block.rb', line 8

def get_title alternative
  title.empty? ?  alternative : title
end

#rangeObject



12
13
14
# File 'lib/lab42/literate/extractor/block.rb', line 12

def range
  start_lnb..(start_lnb.pred + lines.size)
end