Class: Lab42::Literate::Extractor::Block
- Inherits:
-
Object
- Object
- Lab42::Literate::Extractor::Block
- Defined in:
- lib/lab42/literate/extractor/block.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#start_lnb ⇒ Object
readonly
Returns the value of attribute start_lnb.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
2 3 4 |
# File 'lib/lab42/literate/extractor/block.rb', line 2 def lines @lines end |
#start_lnb ⇒ Object (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 |
#title ⇒ Object (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 |
#range ⇒ Object
12 13 14 |
# File 'lib/lab42/literate/extractor/block.rb', line 12 def range start_lnb..(start_lnb.pred + lines.size) end |