Class: Speculations::Parser::Context::Example
- Inherits:
-
Object
- Object
- Speculations::Parser::Context::Example
- Defined in:
- lib/speculations/parser/context/example.rb
Instance Attribute Summary collapse
-
#lnb ⇒ Object
readonly
Returns the value of attribute lnb.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#lnb ⇒ Object (readonly)
Returns the value of attribute lnb.
3 4 5 |
# File 'lib/speculations/parser/context/example.rb', line 3 def lnb @lnb end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
3 4 5 |
# File 'lib/speculations/parser/context/example.rb', line 3 def parent @parent end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/speculations/parser/context/example.rb', line 3 def title @title end |
Instance Method Details
#add_line(line) ⇒ Object
6 7 8 9 |
# File 'lib/speculations/parser/context/example.rb', line 6 def add_line line lines << line self end |
#lines ⇒ Object
11 12 13 |
# File 'lib/speculations/parser/context/example.rb', line 11 def lines @__lines__ ||= [] end |
#to_code ⇒ Object
15 16 17 18 19 |
# File 'lib/speculations/parser/context/example.rb', line 15 def to_code parent.map_lines(_example_head) + parent.map_lines(lines, indent: 1) + parent.map_lines("end") end |