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.
6 7 8 |
# File 'lib/lab42/literate/extractor/block.rb', line 6 def lines @lines end |
#start_lnb ⇒ Object (readonly)
Returns the value of attribute start_lnb.
6 7 8 |
# File 'lib/lab42/literate/extractor/block.rb', line 6 def start_lnb @start_lnb end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/lab42/literate/extractor/block.rb', line 6 def title @title end |
Instance Method Details
#add_line(line) ⇒ Object
8 9 10 |
# File 'lib/lab42/literate/extractor/block.rb', line 8 def add_line line lines << line end |
#get_title(alternative) ⇒ Object
13 14 15 |
# File 'lib/lab42/literate/extractor/block.rb', line 13 def get_title alternative title.empty? ? alternative : title end |
#given? ⇒ Boolean
18 19 20 21 22 |
# File 'lib/lab42/literate/extractor/block.rb', line 18 def given? parsed.children.first.children == [nil, :Given] rescue false end |
#range ⇒ Object
24 25 26 |
# File 'lib/lab42/literate/extractor/block.rb', line 24 def range start_lnb..(start_lnb.pred + lines.size) end |